[Edinburgh-pm] A little perl help please

Chris Benson chrisb at jesmond.demon.co.uk
Sat Feb 18 13:57:54 PST 2006

On Sat, Feb 18, 2006 at 10:42:48AM +0000, asmith9983 at gmail.com wrote:
> Hi guys
> I want this little perl one-liner to run without assigning the return of gmtime 
> to an array.  Is this possible  ?
> Soomething like this but as this doesn't work,not this
> perl -e -w 'use strict "vars";print "Today is Friday" if (gmtime[6] == 5);'

And make sure that the code to evaluate is immediately after the -e.

In the above example, Perl will evaluate -w

perl -lwe 'print "Friday" if 5 == (gmtime)[6]'
Chris Benson

More information about the Edinburgh-pm mailing list