> If *GET =>$url* is a method invocation here, what is the operator => stands
> for?
'=>' is equal to ',' in perl,so you can write it as:
HTTP::Request->new('GET',$url);
Here both 'GET' and $url are the arguments of new().
>What's it context? list or scalar?
>
These are the basic concepti
On Mon, Feb 12, 2007 at 03:31:01PM +0800, Spark Shen wrote:
> Hi:
>
> I am a fresh bird on perl. :-) Could gurus help me to understand this
> statement.
>
> *HTTP::Request->new(GET => $url);*
>
> How does perl parse the struct *GET => $url* here.
>
> I found out GET is a method defined in HTTP:
Spark Shen wrote:
> Hi:
Hello,
> I am a fresh bird on perl. :-) Could gurus help me to understand this
> statement.
>
> *HTTP::Request->new(GET => $url);*
>
> How does perl parse the struct *GET => $url* here.
(GET => $url) is a list of two elements. It could also be written as ('GET',
$url)
Hi:
I am a fresh bird on perl. :-) Could gurus help me to understand this
statement.
*HTTP::Request->new(GET => $url);*
How does perl parse the struct *GET => $url* here.
I found out GET is a method defined in HTTP::Request::Common. If *GET =>
$url* is a method invocation here, what is the ope
On Feb 11, 2007, at 9:39 PM, [EMAIL PROTECTED] wrote:
Well, here's my problem: I have found a way to wrap a text file down
to a narrower column width. But it looses paragraph formatting.
What I need
is the same thing as converting a file from DOS (line break after each
line) to Windows (line
Well, here's my problem: I have found a way to wrap a text file down
to a narrower column width. But it looses paragraph formatting. What I need
is the same thing as converting a file from DOS (line break after each
line) to Windows (line break after each paragraph) format, no?
> From: [EMAIL P
No, I hope to fix that, but I want to avoid having to save it in files.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Sun, 11 Feb 2007, Peter Scott wrote:
On Sun, 11 Feb 2007 13:42:39 +, Jorge Almeida wrote:
Is there some efficient way to get a user/group name out of a numerical
uid/gid (in Linux)?
Why, yes. perldoc -f getpwuid, perldoc -f getgrgid.
Thank you.
--
Jorge Almeida
--
To unsubscribe, e
On Sun, 11 Feb 2007 13:42:39 +, Jorge Almeida wrote:
> Is there some efficient way to get a user/group name out of a numerical
> uid/gid (in Linux)?
> Something like
> $username=getusername($uid)
>
> (Of course, one can parse /etc/passwd, build a hash, etc. Is there
> something like this
On Sun, 11 Feb 2007 00:38:02 +, vjp2 wrote:
> I wonder if it is possibl to merge these two perl one liners inside one perl
> one liners, by putting the pipe statement inside?
>
> speach () { cat $1 | perl -n00e'tr/\t\r\n/ /s; print qq($1\n) while
> s/^(.{0,36}\S)\s+//;print qq(\n)' | perl -pe
Mathew Snyder schreef:
> I need to make sure $day and $month are in 2-digit format
Don't mix value and presentation.
Variant-1:
perl -wle'
my $i = 0;
my ($day, $month, $year) =
map $_ + (0, 1, 1900)[$i++], (localtime)[3..5];
printf qq/%04d %02d %02d\n/, $year, $month, $day;
'
Is there some efficient way to get a user/group name out of a numerical
uid/gid (in Linux)?
Something like
$username=getusername($uid)
(Of course, one can parse /etc/passwd, build a hash, etc. Is there
something like this ready to use?)
--
Jorge Almeida
--
To unsubscribe, e-mail: [EMAI
On Feb 11, 2007, at 1:36 AM, [EMAIL PROTECTED] wrote:
I wonder if there is a format that preserves paragraph breaks while it
kills line breaks?
How do you define a paragraph break. Why does the subject mentions
DOS to Windows.
-- fxn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
I wonder if it is possibl to merge these two perl one liners inside one perl
one liners, by putting the pipe statement inside?
speach () { cat $1 | perl -n00e'tr/\t\r\n/ /s; print qq($1\n) while
s/^(.{0,36}\S)\s+//;print qq(\n)' | perl -pe 'if ($.%4==2) {$_ .= qq(\n).(q(-)
x 37).qq(\n)} elsif (
I wonder if there is a format that preserves paragraph breaks while it
kills line breaks?
speach () { cat $1 | perl -n00e'tr/\t\r\n/ /s; print qq($1\n) while
s/^(.{0,36}\S)\s+//;print qq(\n)' | perl -pe 'if ($.%4==2) {$_ .= qq(\n).(q(-)
x 37).qq(\n)} elsif ($.%4==0) {$_ .= qq(\n).(q(=) x 37).q
Rob Dixon wrote:
> Mathew Snyder wrote:
>> Tom Phoenix wrote:
>>> On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote:
>>>
I'm running this as a cron job 1 minute after midnight on Saturday
nights (Sunday morning) so as to cover all of Saturday back through the
previous Sunday. Does your su
On Sun, 11 Feb 2007 03:51:17 -0500
Mathew Snyder <[EMAIL PROTECTED]> wrote:
> Jeff Pang wrote:
> >> #!/usr/bin/perl
> >>
> >> use warnings;
> >> use strict;
> >>
> >> my @date = (localtime (time - (24*60*60)))[3..5];
> >>
> >> foreach my $i (@date) {
> >>print $i . "\n";
> >> }
> >>
>
Mathew Snyder wrote:
> Tom Phoenix wrote:
>> On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote:
>>
>>> I'm running this as a cron job 1 minute after midnight on Saturday
>>> nights (Sunday morning) so as to cover all of Saturday back through the
>>> previous Sunday. Does your suggestion mean I'd have t
>
>I need to make sure $day and $month are in 2-digit format so that wouldn't
>work.
> At least, not anyway I'm presently familiar with. I tried to use sprintf in
>there but it failed because of not enough arguments.
$day = '0' . $day if length($day) < 2;
$month = '0' . $month if length($month
Owen wrote:
> On Sun, 11 Feb 2007 03:18:00 -0500
> Mathew Snyder <[EMAIL PROTECTED]> wrote:
>
>> Tom Phoenix wrote:
>>> On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote:
>>>
I'm running this as a cron job 1 minute after midnight on Saturday
nights (Sunday morning) so as to cover all of Saturd
On Sun, 11 Feb 2007 03:18:00 -0500
Mathew Snyder <[EMAIL PROTECTED]> wrote:
> Tom Phoenix wrote:
> > On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote:
> >
> >> I'm running this as a cron job 1 minute after midnight on Saturday
> >> nights (Sunday morning) so as to cover all of Saturday back through th
Jeff Pang wrote:
>> #!/usr/bin/perl
>>
>> use warnings;
>> use strict;
>>
>> my @date = (localtime (time - (24*60*60)))[3..5];
>>
>> foreach my $i (@date) {
>>print $i . "\n";
>> }
>>
>> exit;
>>
>> I get this:
>>
>> 10
>> 1
>> 107
>>
>>
>> I still have to add 1 to the month. Is that r
>
>#!/usr/bin/perl
>
>use warnings;
>use strict;
>
>my @date = (localtime (time - (24*60*60)))[3..5];
>
>foreach my $i (@date) {
>print $i . "\n";
>}
>
>exit;
>
>I get this:
>
>10
>1
>107
>
>
>I still have to add 1 to the month. Is that right? Also, the year still needs
>to be fixed
Tom Phoenix wrote:
> On 2/9/07, Mathew <[EMAIL PROTECTED]> wrote:
>
>> I'm running this as a cron job 1 minute after midnight on Saturday
>> nights (Sunday morning) so as to cover all of Saturday back through the
>> previous Sunday. Does your suggestion mean I'd have to run it late
>> Sunday nigh
24 matches
Mail list logo