Emen Zhao wrote:
This is off topic. But I'm just curious about why "4096" is picked here. Is
there any particular reason behind it? I guess you can even calc the lines
like this -
perl -0777 -wne 'print scalar ($_=~s/\n//g)' filename
Except that it's slower than using tr///:
$ time perl -ln077
On Thu, Apr 16, 2009 at 00:58, Emen Zhao wrote:
> This is off topic. But I'm just curious about why "4096" is picked here. Is
> there any particular reason behind it? I guess you can even calc the lines
> like this -
> perl -0777 -wne 'print scalar ($_=~s/\n//g)' filename
>
> Thanks,
> Emen
>
409
This is off topic. But I'm just curious about why "4096" is picked here. Is
there any particular reason behind it? I guess you can even calc the lines
like this -
perl -0777 -wne 'print scalar ($_=~s/\n//g)' filename
Thanks,
Emen
Thanks Jay, Chas and all others.Will try WWW:Mechanzie.
2009/4/15 Jay Savage :
> MWWW::Mechanzie
> (http://search.cpan.org/dist/WWW-Mechanize/lib/WWW/Mechanize.pm) was
> designed to do just this. There's no need to reinvent the wheel by
> trying to cobble something out of LWP::Simple and HTML::Pa
On Wed, Apr 15, 2009 at 6:33 AM, John W. Krahn wrote:
> Robert Citek wrote:
>>
>> You probably want ($Lang == "fr")
>
> Probably not. You are using a numerical comparison on a string which will
> convert the string to a number so that is the same as saying: ($Lang == 0)
You are correct. Serves
I'd suggest placing your pipeline of commands into a bash shell script and
running it manually from the command line and carefully observing it running.
That way you are then dealing with a known quantity outwith any Perl issues.
As someone else replied, consider using the "qx" command rather th
On Wed, Apr 15, 2009 at 10:41, John W. Krahn wrote:
> Chas. Owens wrote:
>>
>> On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote:
>>>
>>> I am trying to execute the below line in the perl program and returns a
>>> value 0.
>>>
>>> my $test2 = "";
>>> my $include = "file";
>>>
>>> $test2 = syste
Chas. Owens wrote:
On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote:
I am trying to execute the below line in the perl program and returns a
value 0.
my $test2 = "";
my $include = "file";
$test2 = system("/usr/atria/bin/cleartool desc \$include | grep created |
awk -F\" \" \'{print \$2}\'
On Wed, Apr 15, 2009 at 10:02 AM, Chas. Owens wrote:
> On Wed, Apr 15, 2009 at 09:38, wrote:
>> Greetings,
>>
>>
>> What's the easy way to calculate a webpage's downloading time?
>> (not only the page, but all the elements in this page, like images,
>> JS, css etc).
>> For example, I want to get
On 15 Apr 2009, at 13:01, John W. Krahn wrote:
Dermot wrote:
2009/4/14 Chas. Owens :
On Tue, Apr 14, 2009 at 11:49, Rick wrote:
is it true that perl will be just as fast as c for reading files ?
for example
cow...@amans:~$ time cat /usr/share/dict/words | perl wc.pl
my $count = 0;
$/ =
On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote:
snip
> $test2 = system("/usr/atria/bin/cleartool desc \$include | grep created |
> awk -F\" \" \'{print \$2}\' | cut -b 1-9 ");
snip
You might also want to look on CPAN[1] for interfaces to cleartool[2].
Many people use Perl with ClearCase, so th
On Wed, Apr 15, 2009 at 09:38, wrote:
> Greetings,
>
>
> What's the easy way to calculate a webpage's downloading time?
> (not only the page, but all the elements in this page, like images,
> JS, css etc).
> For example, I want to get a function:
>
> my $dl_time = fetch_a_page("www.yahoo.com");
s
Just a thought -
A web page (say www.yahoo.com) may contain several links, some of which could
be non-traditional html (e.g. media files, Flash files, etc). Do you want
"fetch_a_page" to just read the URI of the hyperlink or even "consume" (parse,
read, etc.) the URI?
Also, since reading the
Just a thought, maybe you can simplify the "whole thing" using shell and Perl
as follows -
include=file
/usr/atria/bin/cleartool desc $include | grep created | awk -F " " '{print
$2}' | cut -b 1-9 | perl -w -e 'print '
-- Jayesh
- Original Message
From: Owen
To: Rajini Naidu
Cc
On Wed, Apr 15, 2009 at 09:39, Owen wrote:
snip
> You will probably need to specify the full path of grep and awk.
> (usr/bin/grep etc)
snip
Whereas that is not a bad thing to do, it is not his/her
current problem. The system function is returning 0
which means that it was successful. The probl
> Hi,
>
> I am trying to execute the below line in the perl program and returns
> a
> value 0.
>
> my $test2 = "";
> my $include = "file";
>
> $test2 = system("/usr/atria/bin/cleartool desc \$include | grep
> created |
> awk -F\" \" \'{print \$2}\' | cut -b 1-9 ");
>
> The value returned by $tes
Greetings,
What's the easy way to calculate a webpage's downloading time?
(not only the page, but all the elements in this page, like images,
JS, css etc).
For example, I want to get a function:
my $dl_time = fetch_a_page("www.yahoo.com");
Thanks in advance.
Regards.
--
To unsubscribe, e-ma
On Wed, Apr 15, 2009 at 09:20, Rajini Naidu wrote:
> Hi,
>
> I am trying to execute the below line in the perl program and returns a
> value 0.
>
> my $test2 = "";
> my $include = "file";
>
> $test2 = system("/usr/atria/bin/cleartool desc \$include | grep created |
> awk -F\" \" \'{print \$2}\'
Hi,
I am trying to execute the below line in the perl program and returns a
value 0.
my $test2 = "";
my $include = "file";
$test2 = system("/usr/atria/bin/cleartool desc \$include | grep created |
awk -F\" \" \'{print \$2}\' | cut -b 1-9 ");
The value returned by $test2 is 0. I suspect grep a
On Wed, Apr 15, 2009 at 03:24, Patrick Kirsch wrote:
snip
> In one file:
>
> package Util;
> use base 'Exporter';
> our @EXPORT = ('foo', 'bar');
>
> sub foo {
> print "foo!";
> }
>
> package Amy;
> use Util; # imports symbols in @EXPORT
> foo();
>
> On execution it gives the error:
> Can't l
On Tue, Apr 14, 2009 at 13:58, Dr.Ruud wrote:
> p...@highdeck.com wrote:
>
>> /:\/\//
>
> Alternative:
>
> m~://~
snip
What drove your choice of tildas here? Normally I would go for once
of the matched delimiters (i.e. (), {}, [], or <>).
--
Chas. Owens
wonkden.net
The most important skill a
On Wed, Apr 15, 2009 at 07:33, John W. Krahn wrote:
> Robert Citek wrote:
>>
>> On Wed, Apr 15, 2009 at 12:08 AM, Brian wrote:
>>>
>>> could someone please help me with this little problem?
>>> I am trying to include an if statement part way through printing.
>>> When the program reaches the line
On Wed, Apr 15, 2009 at 03:15, Tecno-World wrote:
> I read a lot of messages and faqs, but nothing helps really.
>
>
>
> I tried to attach the messages during the ./Configure and the make, but the
> mailing list accepts only 50kB.
You might want to ask this question on the Perl5 Porters list[1].
Robert Citek wrote:
On Wed, Apr 15, 2009 at 12:08 AM, Brian wrote:
could someone please help me with this little problem?
I am trying to include an if statement part way through printing.
When the program reaches the line if ($Lang = fr ) { print "
that line gets ignored and the cgi keeps g
You probably want ($Lang == "fr")
Regards,
- Robert
On Wed, Apr 15, 2009 at 12:08 AM, Brian wrote:
> could someone please help me with this little problem?
> I am trying to include an if statement part way through printing.
> When the program reaches the line if ($Lang = fr ) { print "
> that
Dermot wrote:
2009/4/14 Chas. Owens :
On Tue, Apr 14, 2009 at 11:49, Rick wrote:
is it true that perl will be just as fast as c for reading files ?
for example
cow...@amans:~$ time cat /usr/share/dict/words | perl wc.pl
my $count = 0;
$/ = \4096;
while (<>) {
$count += tr/\n//;
p...@highdeck.com wrote:
/:\/\//
Alternative:
m~://~
> print( ( split /\// )[ 2 ] );
print +( split m~/~ )[ 2 ];
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
2009/4/14 Chas. Owens :
> On Tue, Apr 14, 2009 at 11:49, Rick wrote:
>> is it true that perl will be just as fast as c for reading files ?
>>
>> for example
>>
> cow...@amans:~$ time cat /usr/share/dict/words | perl wc.pl
> my $count = 0;
>
> $/ = \4096;
> while (<>) {
> $count += tr/\n//
>
>
>
> -Original Message-
> From: Owen [mailto:rc...@pcug.org.au]
> Sent: Wednesday, April 15, 2009 3:16 PM
> To: Gowri Chandra Sekhar Barla, TLS, Chennai
> Subject: RE: Reg:Regular expression
>
>>
>>
>>
>> -Original Message-
>> From: Owen [mailto:rc...@pcug.org.au]
>> Sent: Wedne
Hi owen,
Please find the test.txt in theattachments.
Thanks and regards,
Gowri
-Original Message-
From: Owen [mailto:rc...@pcug.org.au]
Sent: Wednesday, April 15, 2009 2:19 PM
To: Gowri Chandra Sekhar Barla, TLS, Chennai
Cc: Perl Beginners
Subject: RE: Reg:Regular expression
>
> Hi o
>
> Hi owen,
>
> Please help me in resolving errors in the following script
>
> open(INPUT," open(OUTPUT,">new.txt");
> $temp = \/user\/gowri\/remote2;
> while ( ) {
> $_ =~ s{\\/user\\/cce\\/g_tool}{$temp};
> print OUTPUT $_;
> }
Well, I can try.
But why don't you help me by sending a few l
Hi owen,
Please help me in resolving errors in the following script
open(INPUT,"new.txt");
$temp = \/user\/gowri\/remote2;
while ( ) {
$_ =~ s{\\/user\\/cce\\/g_tool}{$temp};
print OUTPUT $_;
}
Error:
Bareword found where operator expected at example1.pl line 5, near "$_
=~ s{\\/user"
(Migh
>
> Hi .
>
>
>
> Please help me in resolving errors in the following script
>
>
>
> 1.open(INPUT,"
> 2.open(OUTPUT,">new.txt");
>
> 3.$temp = \/user\/gowri\/rem2;
>
> 4.while ( ) {
>
> 5.$_ =~ s{\\/user\\/cce\\/dbg_tool}{$temp};
>
> 6.print OUTPUT $_;
>
> 7.}
>
>
>
> Errors:
>
> Bareword found wh
Patrick Kirsch wrote:
Hey list,
I'm sure you can direct me:
I have several packages together in one file and now I would like "use"
the packages. Now my problem is that Perl's "use" wants to have a file
and does not search in the executed file, see example:
In one file:
package Util;
use base
Hi .
Please help me in resolving errors in the following script
1.open(INPUT,"new.txt");
3.$temp = \/user\/gowri\/rem2;
4.while ( ) {
5.$_ =~ s{\\/user\\/cce\\/dbg_tool}{$temp};
6.print OUTPUT $_;
7.}
Errors:
Bareword found where operator expected at example1.pl line 5, near "$
Hey list,
I'm sure you can direct me:
I have several packages together in one file and now I would like "use"
the packages. Now my problem is that Perl's "use" wants to have a file
and does not search in the executed file, see example:
In one file:
package Util;
use base 'Exporter';
our @EXPORT
Thomas Bätzler wrote:
Brian wrote:
could someone please help me with this little problem?
I am trying to include an if statement part way through printing.
When the program reaches the line if ($Lang = fr ) { print "
that line gets ignored and the cgi keeps going to the end.
thanks
Brian
I read a lot of messages and faqs, but nothing helps really.
I tried to attach the messages during the ./Configure and the make, but
the mailing list accepts only 50kB.
I filtered the messages a little bit
Where is the error, what goes wrong?
The System is a at91 ARM CPU from Atmel, i use
38 matches
Mail list logo