[28275] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9639 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 23 14:05:47 2006

Date: Wed, 23 Aug 2006 11:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Aug 2006     Volume: 10 Number: 9639

Today's topics:
        Calling another cgi program using CGI.pm dmedhora@gmail.com
    Re: Calling another cgi program using CGI.pm xhoster@gmail.com
    Re: Calling another cgi program using CGI.pm dmedhora@gmail.com
    Re: Calling another cgi program using CGI.pm xhoster@gmail.com
    Re: Help in comparision and writting in Matrix form <vedpsingh@gmail.com>
    Re: Help in comparision and writting in Matrix form <vedpsingh@gmail.com>
    Re: how can I find the driver list in perl <jurgenex@hotmail.com>
    Re: how can I find the driver list in perl anno4000@radom.zrz.tu-berlin.de
    Re: how can I find the driver list in perl <odperry@gmail.com>
    Re: how can I find the driver list in perl <David.Squire@no.spam.from.here.au>
    Re: how can I find the driver list in perl <odperry@gmail.com>
    Re: how can I find the driver list in perl <syscjm@gwu.edu>
    Re: how can I find the driver list in perl <glennj@ncf.ca>
        Inline::Tcl vs. Inline::Tcl <mumia.w.18.spam+nospam.usenet@earthlink.net>
    Re: Most useful standard module? <john@castleamber.com>
    Re: perl for windows <VN@VN.VN>
    Re: perl for windows <Larry.Martell@gmail.com>
    Re: perl for windows <john@castleamber.com>
    Re: perl for windows <segraves_f13@mindspring.com>
    Re: Question about UNIVERSAL <bol@adv.magwien.gv.at>
    Re: read file backwards xhoster@gmail.com
        substr taking time <beefstu350@hotmail.com>
    Re: substr taking time <mritty@gmail.com>
    Re: substr taking time <thepoet_nospam@arcor.de>
    Re: substr taking time <tzz@lifelogs.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 23 Aug 2006 08:23:24 -0700
From: dmedhora@gmail.com
Subject: Calling another cgi program using CGI.pm
Message-Id: <1156346604.421662.16660@75g2000cwc.googlegroups.com>

Hi All,

I'm trying out CGI.pm and I've been able to understand how
the textfields, textareas, radio buttons, checkboxes, and submit
buttons etc work.

But can I ask, if upon clicking a submit button I want to call
another CGI perl script, how do i do that ?

So far, using the param function the CGI.pm documentation
only shows how to use conditional printing of variables.

Is there any way I can call another cgi perl file to continue
onto other web pages using CGI ?

I don't want to have to use any barebones html, just CGi functions

Thanks!



------------------------------

Date: 23 Aug 2006 15:34:10 GMT
From: xhoster@gmail.com
Subject: Re: Calling another cgi program using CGI.pm
Message-Id: <20060823113441.227$k6@newsreader.com>

dmedhora@gmail.com wrote:
> Hi All,
>
> I'm trying out CGI.pm and I've been able to understand how
> the textfields, textareas, radio buttons, checkboxes, and submit
> buttons etc work.
>
> But can I ask, if upon clicking a submit button I want to call
> another CGI perl script, how do i do that ?

It isn't exactly clear what you want, it seems like you lack a fundamental
understanding of what CGI is--when the user hits submit in a web form, it
is the browser, not the server, that does the calling.  Are you aware of
the -action argument to start_form?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 23 Aug 2006 09:27:44 -0700
From: dmedhora@gmail.com
Subject: Re: Calling another cgi program using CGI.pm
Message-Id: <1156350464.237228.137470@h48g2000cwc.googlegroups.com>

I have an index.pl script that i put in my cgi-bin
Lets say its a simple login screen, so get a username
and a password. Validate that against a mysql database
using DBI and then if the password is correct, go to another
page ( another perl script that will use CGI to gather/update/view
other information from a database ? hope this sounds right)
Thats what i want to do basically. But I don't know how to do
that on clicking the submit button.

Lets say if the index.pl program above validates the user/password
successfully then  how do I continue to another html page?
say, continue.pl
:)
Thanks

xhoster@gmail.com wrote:
> dmedhora@gmail.com wrote:
> > Hi All,
> >
> > I'm trying out CGI.pm and I've been able to understand how
> > the textfields, textareas, radio buttons, checkboxes, and submit
> > buttons etc work.
> >
> > But can I ask, if upon clicking a submit button I want to call
> > another CGI perl script, how do i do that ?
>
> It isn't exactly clear what you want, it seems like you lack a fundamental
> understanding of what CGI is--when the user hits submit in a web form, it
> is the browser, not the server, that does the calling.  Are you aware of
> the -action argument to start_form?
>
> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service                        $9.95/Month 30GB



------------------------------

Date: 23 Aug 2006 16:54:08 GMT
From: xhoster@gmail.com
Subject: Re: Calling another cgi program using CGI.pm
Message-Id: <20060823125439.376$2L@newsreader.com>

dmedhora@gmail.com wrote:
> I have an index.pl script that i put in my cgi-bin
> Lets say its a simple login screen, so get a username
> and a password. Validate that against a mysql database
> using DBI and then if the password is correct, go to another
> page ( another perl script that will use CGI to gather/update/view
> other information from a database ? hope this sounds right)

If you don't want a session, just a one-off check and then do something,
then why not just do the password check in the same script that does
whatever it is you want to do?

> Thats what i want to do basically. But I don't know how to do
> that on clicking the submit button.
>
> Lets say if the index.pl program above validates the user/password
> successfully then  how do I continue to another html page?
> say, continue.pl

Take the validation code out of index.pl, and put in continue.pl (or put it
in my_validate.pm and use that library from continue.pl.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 23 Aug 2006 10:25:44 -0700
From: "Ved" <vedpsingh@gmail.com>
Subject: Re: Help in comparision and writting in Matrix form
Message-Id: <1156353944.586809.138160@b28g2000cwb.googlegroups.com>

Thanks to All of you.
You have provided me what I exactly needed. I am becoming more
confident in using PERL.

Thanks again


John W. Krahn wrote:
> Ved wrote:
> > Hi all,
> > I have posted this message in perl.beginers,but didnt get any reply so
> > am posting here.
>
> You have posted from Google Groups which has read-only access to the Perl
> beginners mailing list.  To post to the actual mailing list go to
> http://lists.cpan.org/showlist.cgi?name=beginners and subscribe.
>
>
> > I have two set of data which I need to comapre.
> > The data set is actually a 16x16 Matrix.
> >
> > Till now I am reading one row at a time by manually changing the
> > @comp_vhdl0, @comp_vhdl1.... till @comp_vhdl15  and so on.
> >  I want:
> > 1)  this to be done  using some loop (or some other better method) and
> > then write it to a file in 16x16 matrix form.
>
> use constant ROW_LEN => 16;
>
> my @comp_vhdl = map [ splice @VHDL, 0, ROW_LEN ], 0 .. $#VHDL / ROW_LEN;
>
> my @comp = map [ splice @C_based, 0, ROW_LEN ], 0 .. $#C_based / ROW_LEN;
>
> print "The VHDL items are:\n";
> printf '%20f' x ROW_LEN, @$_ for @comp_vhdl;
>
> print "The C items are:\n";
> printf '%20f' x ROW_LEN, @$_ for @comp;
>
>
> > 2) After that I want to compare the corresponding values and write the
> > results in a Marix form( say 1 if match occurs and 0 when mismatch). So
> > result looks like this
> >
> > 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
> > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
> > ..........
> > ..........
> > 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
>
> print "Comparison:\n";
> for my $index ( 0 .. $#comp ) {
>     print join ' ', map $comp_vhdl[ $index ][ $_ ] == $comp[ $index ][ $_ ] ?
> 1 : 0, 0 .. $#{ $comp[ $index ] };
>     }
> 
> 
> 
> John
> -- 
> use Perl;
> program
> fulfillment



------------------------------

Date: 23 Aug 2006 10:25:52 -0700
From: "Ved" <vedpsingh@gmail.com>
Subject: Re: Help in comparision and writting in Matrix form
Message-Id: <1156353952.391298.36270@m79g2000cwm.googlegroups.com>

Thanks to All of you.
You have provided me what I exactly needed. I am becoming more
confident in using PERL.

Thanks again



------------------------------

Date: Wed, 23 Aug 2006 15:06:47 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: how can I find the driver list in perl
Message-Id: <ba_Gg.28346$uV.25042@trnddc08>

Over G wrote:
> What command should I use IN THE PERL LANGUAGE in order  to get the
> list of available HD in my computer.

I am confused.
Are you looking for the drivers that are installed for your OS, like video 
driver, audio driver, smart card driver, ... That seemed to be your original 
question.
Or are you looking for a list of hard drives that are installed in your 
computer? That's what you seem to be asking now.

jue 




------------------------------

Date: 23 Aug 2006 15:17:17 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: how can I find the driver list in perl
Message-Id: <4l39rtF2cflU1@news.dfncis.de>

Over G <odperry@gmail.com> wrote in comp.lang.perl.misc:
> 
> Tad McClellan wrote:
> > Over G <odperry@gmail.com> wrote:

> > You asked a question that has nothing to do with Perl programming.
> >
> > This is the Perl programming newsgroup you know...
> I will rephrase :
> 
> What command should I use IN THE PERL LANGUAGE in order  to get the
> list of available HD in my computer.
> thanks.

Simple.  There is no such command in the Perl language.

Now piss off.

Anno


------------------------------

Date: 23 Aug 2006 08:35:34 -0700
From: "Over G" <odperry@gmail.com>
Subject: Re: how can I find the driver list in perl
Message-Id: <1156347334.741873.284390@m79g2000cwm.googlegroups.com>


J=FCrgen Exner wrote:
> Over G wrote:
> > What command should I use IN THE PERL LANGUAGE in order  to get the
> > list of available HD in my computer.
>
> I am confused.
> Are you looking for the drivers that are installed for your OS, like video
> driver, audio driver, smart card driver, ... That seemed to be your origi=
nal
> question.
> Or are you looking for a list of hard drives that are installed in your
> computer? That's what you seem to be asking now.
>
> jue
What I meant in the beginning, and got the weird answers, was , and
still is HD, Hard disk.

not the list of drviers that insall in my computer, but the names of
the HD installed , so if for example I have western digital installed
on my computer and I call it drive C: I want some command to tell me
that you have C: and D: and F: and so on...

I hope this is clear now, altough I can not really understand how can
you understand my original question diffrently ,asside from the one
that call himself DR.



------------------------------

Date: Wed, 23 Aug 2006 16:40:56 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: how can I find the driver list in perl
Message-Id: <echsu8$c8s$1@gemini.csx.cam.ac.uk>

Over G wrote:

> 
> not the list of drviers that insall in my computer, but the names of
> the HD installed , so if for example I have western digital installed
> on my computer and I call it drive C: I want some command to tell me
> that you have C: and D: and F: and so on...
> 
> I hope this is clear now, altough I can not really understand how can
> you understand my original question diffrently 

You asked about a list of *drivers*. No wonder everyone thought you 
wanted a list of drivers.


DS


------------------------------

Date: 23 Aug 2006 08:42:06 -0700
From: "Over G" <odperry@gmail.com>
Subject: Re: how can I find the driver list in perl
Message-Id: <1156347726.331653.243480@74g2000cwt.googlegroups.com>


anno4000@radom.zrz.tu-berlin.de wrote:
> Over G <odperry@gmail.com> wrote in comp.lang.perl.misc:
> >
> > Tad McClellan wrote:
> > > Over G <odperry@gmail.com> wrote:
>
> > > You asked a question that has nothing to do with Perl programming.
> > >
> > > This is the Perl programming newsgroup you know...
> > I will rephrase :
> >
> > What command should I use IN THE PERL LANGUAGE in order  to get the
> > list of available HD in my computer.
> > thanks.
>
> Simple.  There is no such command in the Perl language.
>
> Now piss off.



excuse me bu t who are you to tell me to piss off. ?

if you lack the knowledge that is required to answer such a question,
means that you don't know enough perl , please don't answer or save us
your low enligsh that belong to the red neck.
 . 

I



------------------------------

Date: Wed, 23 Aug 2006 12:51:47 -0400
From: Chris Mattern <syscjm@gwu.edu>
Subject: Re: how can I find the driver list in perl
Message-Id: <12ep1t4oto2br97@corp.supernews.com>

Over G wrote:
> Jürgen Exner wrote:
> 
>>Over G wrote:
>>
>>>What command should I use IN THE PERL LANGUAGE in order  to get the
>>>list of available HD in my computer.
>>
>>I am confused.
>>Are you looking for the drivers that are installed for your OS, like video
>>driver, audio driver, smart card driver, ... That seemed to be your original
>>question.
>>Or are you looking for a list of hard drives that are installed in your
>>computer? That's what you seem to be asking now.
>>
>>jue
> 
> What I meant in the beginning, and got the weird answers, was , and
> still is HD, Hard disk.

How stupid of us not to wear our telepathy caps so we could answer
what you meant instead of what you said.

> 
> not the list of drviers that insall in my computer, but the names of
> the HD installed , so if for example I have western digital installed
> on my computer and I call it drive C: I want some command to tell me
> that you have C: and D: and F: and so on...
> 
> I hope this is clear now, altough I can not really understand how can
> you understand my original question diffrently ,asside from the one
> that call himself DR.
> 

No, it was *not* obvious.  DR chose an obviously incorrect
interpretation to attempt to point to you how vague you were
being.  My own personal best guess as to what you meant was in fact
incorrect, as I foolishly assumed that since you said "drivers"
you were actually interested in information about drivers.  Learn to
express yourself clearly and precisely and you will most
likely find it much easier to get answers to your questions.
What you mean is perfectly obvious to you, because you know
your own thoughts.  The rest of us do not enjoy this advantage.
Learn precision in your language, please.


Chris Mattern


------------------------------

Date: 23 Aug 2006 17:05:38 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: how can I find the driver list in perl
Message-Id: <slrneep2n3.2a3.glennj@smeagol.ncf.ca>

At 2006-08-23 11:02AM, "Paul Lalli" wrote:
>  The answer depends entirely on what system you're on.  You didn't
>  include that, so I'll assume Microsoft Windows (because that's the
>  question to which I know the answer).
>  
>  Go to http://search.cpan.org and search for "Win32::DriveInfo"

That search also reveals Sys::Filesystem for non-windows systems.

-- 
Glenn Jackman
Ulterior Designer


------------------------------

Date: Wed, 23 Aug 2006 16:09:52 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Inline::Tcl vs. Inline::Tcl
Message-Id: <k5%Gg.630$bM.398@newsread4.news.pas.earthlink.net>

The readme for CPAN's Inline::Tcl says this:

> This module is not related to the Inline::Tcl module, but it might be 
> valuable to have some compatibility between the two.
> 

This sentence seems to suggest that there is another module 
named Inline::Tcl somewhere. Is this true, and if so, where 
can I find it?


------------------------------

Date: 23 Aug 2006 17:20:59 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Most useful standard module?
Message-Id: <Xns98287DA0593Dcastleamber@130.133.1.4>

"Davy" <zhushenli@gmail.com> wrote:

> Hi all,
> 
> I have used Getopt::Std and File::Find. I found standard module useful.
> 
> Is there any artical summarize the most useful standard module?

Not really, and as others have said, it depends on what you are doing, and 
of course its a matter of taste.

Modules I use a lot are (unordered):

LWP::UserAgent;
HTML::TreeBuilder;
File::Slurp;
Storable;
Data::Dumper;

(I am just awake, so there might be typos).



-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: Wed, 23 Aug 2006 17:11:26 +0200
From: VN <VN@VN.VN>
Subject: Re: perl for windows
Message-Id: <44ec6fe8$0$1213$ba620e4c@news.skynet.be>

Larry.Martell@gmail.com wrote:
> The activestate web site seems to be down, and has been for a couple of
> days. Is there another site I can download perl for windows from?
> 

I don't think there is a Activestate's mirror somewhere :)


------------------------------

Date: 23 Aug 2006 10:11:37 -0700
From: "Larry.Martell@gmail.com" <Larry.Martell@gmail.com>
Subject: Re: perl for windows
Message-Id: <1156353097.551729.42160@m73g2000cwd.googlegroups.com>


VN wrote:
> Larry.Martell@gmail.com wrote:
> > The activestate web site seems to be down, and has been for a couple of
> > days. Is there another site I can download perl for windows from?
> >
>
> I don't think there is a Activestate's mirror somewhere :)

FYI, their site just came back up.

-larry



------------------------------

Date: 23 Aug 2006 17:22:07 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: perl for windows
Message-Id: <Xns98287DD1893C0castleamber@130.133.1.4>

"Larry.Martell@gmail.com" <Larry.Martell@gmail.com> wrote:

> The activestate web site seems to be down, and has been for a couple of
> days. Is there another site I can download perl for windows from?

Sounds weird that it's down for a couple of days. But anyway, it works 
again :-)

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


------------------------------

Date: Wed, 23 Aug 2006 17:46:17 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: perl for windows
Message-Id: <Jv0Hg.652$bM.63@newsread4.news.pas.earthlink.net>

<Larry.Martell@gmail.com> wrote in message
news:1156344776.856367.126240@b28g2000cwb.googlegroups.com...
> The activestate web site seems to be down, and has been for a couple of
> days. Is there another site I can download perl for windows from?

IndigoPerl, available free from www.indigostar.com.

--
Bill Segraves




------------------------------

Date: Wed, 23 Aug 2006 18:30:12 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Re: Question about UNIVERSAL
Message-Id: <1156350612.535252@proxy.dienste.wien.at>

First, thanks to all who replied.

Ben Morrow:

> No. Perl already handles cycles in the @ISA hierarchy (with an error);

Is this what "Regexp::DESTROY" is for?

> I would respectfully suggest that if you can't figure this out for
> yourself, you're probably better off staying out of the guts of Deep
> Magic modules like Attribute::Handlers.

You may be right but if I do not attempt to learn somewhat new
from time to time (and often other code contains some very useful
techniques), I will never use Perl in all the ways it is useable. The
more one knows about a language, the better he can use it.

Where your experience come from?

Thanks again for your help & kind regards,

Ferry

-- 
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at




------------------------------

Date: 23 Aug 2006 15:46:43 GMT
From: xhoster@gmail.com
Subject: Re: read file backwards
Message-Id: <20060823114714.468$mw@newsreader.com>

kejoseph@hotmail.com wrote:
> Hi,
>
> I need to read a file in Perl backwards but -
>
> I have read tips about reading the file into an array and then reading
> the array in the reverse. Now, bearing in mind the fact that the log
> files I will be reading will be anywhere from 10-100mb, I dont think
> this is a very good idea.
>
> I have also read about using Perl modules like FileBackwards or
> File::Tie.
>
> I do not want either of the above. I need to know whether there is a
> way to read it backwards without having to use any of the above.

Then do it the way the modules you don't want to use do it.  They already
exist.  If it can done once, it can be done again.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

Date: 23 Aug 2006 09:49:23 -0700
From: "Stu" <beefstu350@hotmail.com>
Subject: substr taking time
Message-Id: <1156351763.534350.212770@p79g2000cwp.googlegroups.com>

I am reading through a file that is 2,432 lines with a record length of
450 bytes. I want to get the first 8 bytes from each line and stick in
into an array. When I excute the following piece of code it takes 7 to
8 seconds.

In comparison, when I issue a  cut -c1-8 < data this from MKS this
takes one second on the same data

Does anybody know of a way on how these lines of code can be optimized.

BTW, I am using Active Perl on a Windows 2003 platform, but that should
not make a difference

print scalar ( localtime() ) . "\n";

        while ($NextLine = <INPUT>)
        {
           @docidarray = (@docidarray, substr($NextLine, 0, 8));
        }

print scalar ( localtime() ) . "\n";



------------------------------

Date: 23 Aug 2006 09:51:10 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: substr taking time
Message-Id: <1156351870.163059.284510@75g2000cwc.googlegroups.com>

Stu wrote:
> I am reading through a file that is 2,432 lines with a record length of
> 450 bytes. I want to get the first 8 bytes from each line and stick in
> into an array. When I excute the following piece of code it takes 7 to
> 8 seconds.
>
> In comparison, when I issue a  cut -c1-8 < data this from MKS this
> takes one second on the same data
>
> Does anybody know of a way on how these lines of code can be optimized.
>
> BTW, I am using Active Perl on a Windows 2003 platform, but that should
> not make a difference
>
> print scalar ( localtime() ) . "\n";
>
>         while ($NextLine = <INPUT>)
>         {
>            @docidarray = (@docidarray, substr($NextLine, 0, 8));

Why are you recopying the entire array every time through the loop?

perldoc -f push

>         }
> 
> print scalar ( localtime() ) . "\n";

Paul Lalli



------------------------------

Date: Wed, 23 Aug 2006 18:52:25 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: substr taking time
Message-Id: <44ec87ac$0$1400$9b4e6d93@newsspool3.arcor-online.net>

Stu wrote:
[...snipped...]
>         while ($NextLine = <INPUT>)
>         {
>            @docidarray = (@docidarray, substr($NextLine, 0, 8));
>         }

make that
while( my $NextLine = <INPUT> )
{
	push @docidarray, substr( $NextLine, 0, 8 );
}

No need to place a copy of the whole array into the memory
with each line read.

HTH
-Chris


------------------------------

Date: Wed, 23 Aug 2006 13:49:24 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: substr taking time
Message-Id: <g69zmdvjqaj.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 23 Aug 2006, beefstu350@hotmail.com wrote:

> I am reading through a file that is 2,432 lines with a record length of
> 450 bytes. I want to get the first 8 bytes from each line and stick in
> into an array. When I excute the following piece of code it takes 7 to
> 8 seconds.
>
> In comparison, when I issue a  cut -c1-8 < data this from MKS this
> takes one second on the same data
>
> Does anybody know of a way on how these lines of code can be optimized.
>
> BTW, I am using Active Perl on a Windows 2003 platform, but that should
> not make a difference
>
> print scalar ( localtime() ) . "\n";
>
> while ($NextLine = <INPUT>)
> {
> @docidarray = (@docidarray, substr($NextLine, 0, 8));
> }
>
> print scalar ( localtime() ) . "\n";

While the advice to use push() is valid, you should realize that a
simple task like this does not require Perl, and you are incurring
quite a bit of overhead when you use Perl.  You'll never be as fast as
`cut' with Perl at doing `cut's job (well, some examples could be
contrived).

Starting up Perl, in particular, takes a while (depending on the
machine, of course).  The modules you are using may also slow you
down.  So the 7-8 seconds time may not be just the processing time.

Then, of course, each statement is run by the Perl interpreter, unlike
a program like `cut' which is very optimized in C to do just one task.

So you have to decide - if the task requires just `cut', use just
that.  You can produce the localtime() output with the `date'
command.  If, however, this is part of a bigger program, you may have
to live with the slight performance hit.

Ted


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9639
***************************************


home help back first fref pref prev next nref lref last post