Jeff 'Japhy' Pinyan wrote:
>
> On Oct 27, John W. Krahn said:
>
> >> So what did "localtime[4]" (without parens) do?
> >
> >my $x = localtime[4];
> >
> >Is the same as:
> >
> >my $x = localtime;
> >
> >Which assigns the scalar value of localtime to $x. The [4] part is
> >ignored.
>
> No, it is
On Oct 27, John W. Krahn said:
>> So what did "localtime[4]" (without parens) do?
>
>my $x = localtime[4];
>
>Is the same as:
>
>my $x = localtime;
>
>Which assigns the scalar value of localtime to $x. The [4] part is
>ignored.
No, it is not ignored. localtime() takes an argument -- a number of
K Pfeiffer wrote:
>
> This lost me for a moment. I figured it out by trying...
>
> #!/usr/bin/perl
> use warnings;
> use strict;
> # test "get uc month from localtime"
>
> my $month = qw(JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV
> DEC)[(localtime)[4]];
>
> print localtime,"\n";
> my $x = loca
John W. Krahn writes:
> Jeff 'Japhy' Pinyan wrote:
[...]
> > my $month = (split ' ', uc localtime)[1];
> >
> > localtime(), in scalar context, returns a string like
> >
> > "Fri Oct 25 10:30:23 2002"
> >
> > I'm uppercasing it, splitting it on whitespace, and getting the 2nd
> > element ("OCT")
Jeff 'Japhy' Pinyan wrote:
>
> On Oct 25, [EMAIL PROTECTED] said:
>
> >my $month = system("date '+%b'");
> >$month = uc $month;
>
> Your problem is that you're misusing system(). system() does NOT return
> output (see perldoc -f system). If you wanted to get output, you'd use
>
> my $month
On Oct 25, [EMAIL PROTECTED] said:
>my $month = system("date '+%b'");
>$month = uc $month;
Your problem is that you're misusing system(). system() does NOT return
output (see perldoc -f system). If you wanted to get output, you'd use
my $month = `date '+%b'`;
but there's NO reason to use a
ase notify us by telephone or
email (to the numbers or address above) immediately.
-Original Message-
From: Jeff 'japhy' Pinyan [mailto:japhy@;perlmonk.org]
Sent: Friday, October 25, 2002 14:56
To: Musto,J,Jonathan,IVYD3 C
Cc: [EMAIL PROTECTED]
Subject: Re: Easy one
On Oct 25, [EMAIL PROTECTED] said:
>How do a convert a string $string into uppercase??
perldoc -f uc
$big = uc $little;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look for "Regu
chomp( $input = );
-Original Message-
From: A. Rivera
To: [EMAIL PROTECTED]
Sent: 11/9/2001 6:06 PM
Subject: Easy one...
I've got a simple question..
How do I do this in one line...
$input=;
chomp($input);
Thanks!
Agustin Rivera
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For