On Mon, Apr 21, 2008 at 9:25 PM, J. Peng <[EMAIL PROTECTED]> wrote:
> On Tue, Apr 22, 2008 at 1:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote:
>
> > Because of a quirk in how the current and past versions of perl parsed
> > and handled the statement. It is a mis-feature according to Larry.
>
>
On Tue, Apr 22, 2008 at 1:58 AM, Chas. Owens <[EMAIL PROTECTED]> wrote:
> Because of a quirk in how the current and past versions of perl parsed
> and handled the statement. It is a mis-feature according to Larry.
Chas, do you mean this is a bad style to declare and assign a variable
like belo
Chas. Owens wrote:
On Mon, Apr 21, 2008 at 11:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
snip
Please read the last para in the "Statement Modifiers" section in "perldoc
perlrun".
snip
I think you mean perlsyn, not perlrun:
http://perldoc.perl.org/perlsyn.html#Statement-Modifiers
Y
Jonathan Mast wrote:
There is a line in script we have that I find baffling, it is
print $cgi->header;
To me this seems to be printing the results of the header method of the CGI
module to standard output.
Correct.
Is something else going on here as well?
That depends on what the current
On Mon, Apr 21, 2008 at 2:45 PM, Jonathan Mast
<[EMAIL PROTECTED]> wrote:
> There is a line in script we have that I find baffling, it is
>
> print $cgi->header;
>
> To me this seems to be printing the results of the header method of the CGI
> module to standard output.
>
> Is something else go
There is a line in script we have that I find baffling, it is
print $cgi->header;
To me this seems to be printing the results of the header method of the CGI
module to standard output.
Is something else going on here as well?
Thanks
[EMAIL PROTECTED] wrote:
>
> I have string like OMS.FD.08.03.000.0 Now my req. is that if the string
> contains .0 at the end then I want to remove that .0 but if any other
> digit is there other than .0 then don't do anything.
>
> For example: if string is : OMS.FD.08.03.000.0 then regular expre
On Mon, Apr 21, 2008 at 10:40 AM, J. Peng <[EMAIL PROTECTED]> wrote:
> I'm not sure, but why this can work?
>
> use strict;
> use warnings;
> use Data::Dumper;
>
> my $y=0;
> my @x =(1,2,3) if $y;
> print Dumper [EMAIL PROTECTED];
>
>
> Since $y is false, it seems @x shouldn't be declared.
>
On Mon, Apr 21, 2008 at 11:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
snip
> Please read the last para in the "Statement Modifiers" section in "perldoc
> perlrun".
snip
I think you mean perlsyn, not perlrun:
http://perldoc.perl.org/perlsyn.html#Statement-Modifiers
--
Chas. Owens
wonkd
On Mon, Apr 21, 2008 at 11:18 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> Mr. Shawn H. Corey wrote:
>
> > The fastest way to do this is to read every line into Perl and disregard
> everything not relevant.
> >
>
> Don't think so.
>
> I did a benchmark on a text file with 100,000 lines, wh
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
I don't have root access.. and then compiler which is gcc on sun
machine messed up my installation.
I tried to install expect and didn't work out. Will gather more
information
Start here:
perldoc -q "own module"
thanks..
Gunnar Hjalmarsson wrote:
J. Peng wrote:
I'm not sure, but why this can work?
use strict;
use warnings;
use Data::Dumper;
my $y=0;
my @x =(1,2,3) if $y;
print Dumper [EMAIL PROTECTED];
Since $y is false, it seems @x shouldn't be declared.
Please read the last para in the "Statement Modifier
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
Unfortunately however, the system I am on, I cannot install any
modules other than standard modules that already come with the perl.
Assuming you have at least FTP access, you are wrong. Which are the
Richard Lee wrote:
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
Unfortunately however, the system I am on, I cannot install any
modules other than standard modules that already come with the perl.
Assuming you have at least FTP access, you are wrong. Which are the
restrictions?
I guess ev
J. Peng wrote:
I'm not sure, but why this can work?
use strict;
use warnings;
use Data::Dumper;
my $y=0;
my @x =(1,2,3) if $y;
print Dumper [EMAIL PROTECTED];
Since $y is false, it seems @x shouldn't be declared.
Please read the last para in the "Statement Modifiers" section in
"perldoc pe
Sharan Basappa wrote:
On Sat, Apr 19, 2008 at 12:35 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
I think it's advisable to follow the recommendation in
perldoc -q "own module"
and use both the PREFIX and LIB options.
Usually I install Perl modules as root, but as a learning exerci
Gunnar Hjalmarsson wrote:
Richard Lee wrote:
Unfortunately however, the system I am on, I cannot install any
modules other than standard modules that already come with the perl.
Assuming you have at least FTP access, you are wrong. Which are the
restrictions?
I guess even that, I should lo
Mr. Shawn H. Corey wrote:
The fastest way to do this is to read every line into Perl and disregard
everything not relevant.
Don't think so.
I did a benchmark on a text file with 100,000 lines, where I'm actually
only interested in the 5 last lines. Except for Tie::File, which proved
to be aw
beyhan wrote:
The key is :
use Tie::File
"Tie::File" represents a regular text file as a Perl array. Each ele‐
ment in the array corresponds to a record in the file. The first
line
of the file is element 0 of the array; the second line is element 1,
and so on.
The
Richard Lee wrote:
Unfortunately however, the system I am on, I cannot install any modules
other than standard modules that already come with the perl.
Assuming you have at least FTP access, you are wrong. Which are the
restrictions?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/
I'm not sure, but why this can work?
use strict;
use warnings;
use Data::Dumper;
my $y=0;
my @x =(1,2,3) if $y;
print Dumper [EMAIL PROTECTED];
Since $y is false, it seems @x shouldn't be declared.
But why the last print can work?
--
J. Peng - QQMail Operation Team
eMail: [EMAIL PROTECTED] A
On Sat, Apr 19, 2008 at 12:35 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
> Sharan Basappa wrote:
>
> > I downloaded version and installed it. That went smoothly. When I go back
> to text-balanced installation, it still does not seem to locate version.pm
> >
>
> I think it's advisable to fol
On Mon, Apr 21, 2008 at 7:17 PM, <[EMAIL PROTECTED]> wrote:
> Hi All,
>
>
>
> I have string like OMS.FD.08.03.000.0 Now my req. is that if the string
> contains .0 at the end then I want to remove that .0 but if any other
> digit is there other than .0 then don't do anything.
>
>
>
> For examp
On Mon, Apr 21, 2008 at 7:17 AM, <[EMAIL PROTECTED]> wrote:
snip
> I have string like OMS.FD.08.03.000.0 Now my req. is that if the string
> contains .0 at the end then I want to remove that .0 but if any other
> digit is there other than .0 then don't do anything.
snip
What have you tried so
Hi All,
I have string like OMS.FD.08.03.000.0 Now my req. is that if the string
contains .0 at the end then I want to remove that .0 but if any other
digit is there other than .0 then don't do anything.
For example: if string is : OMS.FD.08.03.000.0 then regular expression
should give OMS.F
The key is :
use Tie::File
"Tie::File" represents a regular text file as a Perl array. Each ele‐
ment in the array corresponds to a record in the file. The first
line
of the file is element 0 of the array; the second line is element 1,
and so on.
The file is not loa
On Sun, 2008-04-20 at 20:22 -0400, Chas. Owens wrote:
> No, you obviously don't know how it is implemented. It seeks to the
> end of the file and reads it into a buffer where it searches for line
> endings. It does not read the entire file until you reach the first
> line.
>
That's not the poin
On Sun, 2008-04-20 at 18:10 -0400, Richard Lee wrote:
> There is no way to read say last 10 MB of the file or something? It's
> very surprising why no such thing exists..
>
No, it's not.
It is a text file, not a fixed-sized record fix. There is no way to
compute where the lines of text start.
On Sun, 2008-04-20 at 17:02 -0400, Richard Lee wrote:
> Chas. Owens wrote:
> > On Sun, Apr 20, 2008 at 1:49 PM, Richard Lee <[EMAIL PROTECTED]> wrote:
> > snip
> >
> >> can this be optimized in anyway?
> >> open (my $source, '-|', "tail -10 /server/server.log")
> >>
> >> is this the best
From: Richard Lee <[EMAIL PROTECTED]>
> Mr. Shawn H. Corey wrote:
> > It still has to go through the entire file and mark the offsets to the
> > start of every line.
> >
> > The best way to do this is just to bite the bullet and do it.
>
> There is no way to read say last 10 MB of the file or some
30 matches
Mail list logo