Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F9501552
try.pl
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
786 B
Subscribers
None
try.pl
View Options
#!/usr/bin/perl
$
text
=
<>
;
chomp
$
text
;
print
"$text\n"
;
$
text=~s/^\s+//
;
$
text=~s/\s+
$
//
;
@val
=
split
/\s+/
,
$
text
;
print
"$#val\n"
;
$
val
=
"$val[0]"
;
$
next
=
1
;
$
nerr
=
1
;
while
(
$
next<=
$
#val
){
$
pm='true'
;
if
(
$
next<
$
#val
){
if
(
$
val
[
$
next
]
<
0.0
||
$
val
[
$
next
+
1
]
<
0.0
){
$
pm='false'
;
}}
if
(
$
pm
eq
'true'
)
{
if
(
$
nerr
==
1
)
{
$
val
.
=
" +- $val[$next]"
;}
elsif
(
$
nerr
==
2
)
{
$
val
.
=
" (DSYS=$val[$next]"
;}
else
{
$
val
.
=
",DSYS=$val[$next]"
;}
$
next
+=
1
;
}
else
{
if
(
$
nerr
==
1
)
{
$
val
.
=
" +$val[$next],$val[$next+1]"
;
}
elsif
(
$
nerr
==
2
)
{
$
val
.
=
" (DSYS=+$val[$next],$val[$next+1]"
;
}
else
{
$
val
.
=
",DSYS=+$val[$next],$val[$next+1]"
;
}
$
next
+=
2
;
}
$
nerr
+=
1
;
}
if
(
$
nerr
>
2
)
{
$
val
.
=
")"
;
}
print
"$val\n"
;
exit
();
File Metadata
Details
Attached
Mime Type
text/x-perl
Expires
Sun, Feb 23, 2:40 PM (22 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4482170
Default Alt Text
try.pl (786 B)
Attached To
rHEPDATASVN hepdatasvn
Event Timeline
Log In to Comment