Command line switches are handy for some tasks, like -l and -n, which let you write the whole thing in one rather short line:
C:\>perl -lne "print m/^\d{5}$/ ? ' OK' : ' Fail'" 5 Fail 12345 OK 123 Fail Hello Fail 3.141 Fail ^Z
cheers
tachyon
In reply to Re: compare stdin for a number
by tachyon
in thread compare stdin for a number
by anoxer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |