Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number characters in an argument

Status
Not open for further replies.

unixb0y

Technical User
Jul 8, 2003
9
0
0
CA
Hi,

I checked the FAQ/docs and didn't find an answer.

In KSH i can do the following:
if [ /usr/bin/echo $1|/usr/bin/wc -m | -ge 10 ] ; then
print "Argument too long\n"
exit 0
fi

How would I do the "/usr/bin/echo $1|/usr/bin/wc -m | -ge 10" in perl without having to use the shell?

So far i have
if ( {@ARGV[3]} > 8 ) {
print "too large" ;
exit (1);
}

Thanks,
Karl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top