Re: quick perl question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, Oct 21st 2003 at 11:44 -0400, quoth Jake McHenry:

=>Hi everyone, this is a pretty simple question I believe.. but I can't seem
=>to get it...
=>
=>I have a perl script that does a system call to get the date.... everything
=>works fine, but the returned date has a line return character and I can't
=>get rid of it... here's my perl script..
=>
=>$date = `/bin/date +%Y%m%d`;
=>
=>I've tried system("/bin/date ... ");
=>and exec("/bin/date....");
=>
=>all return the date with the line character... how can I get rid of it?

The easy answer is:

chomp ($date);
see: perldoc -f chomp

The correct answer is to not start a seperate process just to find out 
what time it is.

You should definitely buy the Perl Cookbook from O'Reilly. All your 
questions will be answered.

-- 
-Time flies like the wind. Fruit flies like a banana. Stranger things have -
-happened but none stranger than this. Does your driver's license say Organ
-Donor?Black holes are where God divided by zero. Listen to me! We are all-
-individuals! What if this weren't a hypothetical question?
steveo at syslang.net


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux