[30213] in Perl-Users-Digest
Perl-Users Digest, Issue: 1456 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 22 16:17:30 2008
Date: Tue, 22 Apr 2008 13:17:19 -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 Tue, 22 Apr 2008 Volume: 11 Number: 1456
Today's topics:
Re: FAQ 5.3 How do I count the number of lines in a fil <szrRE@szromanMO.comVE>
Re: FAQ 5.3 How do I count the number of lines in a fil <jurgenex@hotmail.com>
Re: FAQ 5.3 How do I count the number of lines in a fil <szrRE@szromanMO.comVE>
Re: FAQ 5.3 How do I count the number of lines in a fil <brian.d.foy@gmail.com>
Re: FAQ 5.3 How do I count the number of lines in a fil <m@rtij.nl.invlalid>
Re: FAQ 5.3 How do I count the number of lines in a fil <1usa@llenroc.ude.invalid>
Re: FAQ 5.3 How do I count the number of lines in a fil <jurgenex@hotmail.com>
floating bar in the line chart <vakayil.thobias@alcatel-lucent.com>
Re: floating bar in the line chart <jurgenex@hotmail.com>
Re: floating bar in the line chart <devnull4711@web.de>
Re: floating bar in the line chart <vakayil.thobias@alcatel-lucent.com>
Re: floating bar in the line chart <vakayil.thobias@alcatel-lucent.com>
Re: floating bar in the line chart <stoupa@practisoft.cz>
Re: floating bar in the line chart <vakayil.thobias@alcatel-lucent.com>
Re: floating bar in the line chart <zentara@highstream.net>
Form Post <screwmeblome@gmail.com>
Re: Form Post <glex_no-spam@qwest-spam-no.invalid>
get quote enclosed field in a line <xahlee@gmail.com>
Re: get quote enclosed field in a line <xng@xs4all.nl>
Re: get quote enclosed field in a line <1usa@llenroc.ude.invalid>
Re: get quote enclosed field in a line <skye.shaw@gmail.com>
Re: get quote enclosed field in a line <eedmit@NO.eed.SPAM.ericsson.PLS.se>
How can I share common data structures and constants <imfeaw5672@pacbell.net>
Re: How can I share common data structures and constant <devnull4711@web.de>
Re: How can I share common data structures and constant <skye.shaw@gmail.com>
Re: How can I share common data structures and constant <spamtrap@dot-app.org>
Re: How can I share common data structures and constant <ramesh.thangamani@gmail.com>
Re: How can I share common data structures and constant <ramesh.thangamani@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 19 Apr 2008 00:26:54 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <fuc6ru07oa@news4.newsguy.com>
PerlFAQ Server wrote:
[...]
> 5.3: How do I count the number of lines in a file?
>
>
> One fairly efficient way is to count newlines in the file. The
> following program uses a feature of tr///, as documented in
> perlop. If your text file doesn't end with a newline, then it's
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Shouldn't this be "If the lines in your text file do not end with a
newline", or something to that effect? A text file need not have a "\n"
at the very end :)
> not really a proper text file, so this may report one fewer line
> than you expect.
[...]
--
szr
------------------------------
Date: Sat, 19 Apr 2008 10:08:39 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <qugj0451qt211m5nf70jgal924879l3v25@4ax.com>
"szr" <szrRE@szromanMO.comVE> wrote:
>PerlFAQ Server wrote:
>[...]
>> 5.3: How do I count the number of lines in a file?
>>
>>
>> One fairly efficient way is to count newlines in the file. The
>> following program uses a feature of tr///, as documented in
>> perlop. If your text file doesn't end with a newline, then it's
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>Shouldn't this be "If the lines in your text file do not end with a
>newline", or something to that effect?
No. It is a different way of saying "If there is stuff after the last
newline then that stuff doesn't constitute a proper line..."
>A text file need not have a "\n"
>at the very end :)
>
>> not really a proper text file, so this may report one fewer line
>> than you expect.
"... and therefore it is not be counted as a line."
jue
------------------------------
Date: Sat, 19 Apr 2008 15:05:49 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <fudqbu021qf@news4.newsguy.com>
Jürgen Exner wrote:
> "szr" <szrRE@szromanMO.comVE> wrote:
>> PerlFAQ Server wrote:
>> [...]
>>> 5.3: How do I count the number of lines in a file?
>>>
>>>
>>> One fairly efficient way is to count newlines in the file. The
>>> following program uses a feature of tr///, as documented in
>>> perlop. If your text file doesn't end with a newline, then it's
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>> Shouldn't this be "If the lines in your text file do not end with a
>> newline", or something to that effect?
>
> No. It is a different way of saying "If there is stuff after the last
> newline then that stuff doesn't constitute a proper line..."
I don't recall there being any sort of rule saying a text file's last
character /has/ to be a line terminator, though I can see how it would
seem better formed if it does.
--
szr
------------------------------
Date: Sun, 20 Apr 2008 15:07:55 -0500
From: brian d foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <200420081507550257%brian.d.foy@gmail.com>
In article <fudqbu021qf@news4.newsguy.com>, szr <szrRE@szromanMO.comVE>
wrote:
> Jürgen Exner wrote:
> > No. It is a different way of saying "If there is stuff after the last
> > newline then that stuff doesn't constitute a proper line..."
>
> I don't recall there being any sort of rule saying a text file's last
> character /has/ to be a line terminator, though I can see how it would
> seem better formed if it does.
There's no rule for it, but a lot of things expect it. Just Google
"no newline at end of file" to see for yourelf.
------------------------------
Date: Sun, 20 Apr 2008 23:47:05 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <pan.2008.04.20.21.47.05@rtij.nl.invlalid>
On Sun, 20 Apr 2008 15:07:55 -0500, brian d foy wrote:
> In article <fudqbu021qf@news4.newsguy.com>, szr <szrRE@szromanMO.comVE>
> wrote:
>
>> Jürgen Exner wrote:
>
>> > No. It is a different way of saying "If there is stuff after the last
>> > newline then that stuff doesn't constitute a proper line..."
>>
>> I don't recall there being any sort of rule saying a text file's last
>> character /has/ to be a line terminator, though I can see how it would
>> seem better formed if it does.
>
> There's no rule for it, but a lot of things expect it. Just Google "no
> newline at end of file" to see for yourelf.
As I understand it, this has always been the rule in unixy environments.
I even think that Dos/Windows is the exception to the rule, and (almost)
all other environments need a line terminator after the last line, but
I'm not to sure about that.
And it makes sens. it's a line terminator, not a line separator....
M4
------------------------------
Date: Sun, 20 Apr 2008 23:37:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <Xns9A86C7B2DF336asu1cornelledu@127.0.0.1>
brian d foy <brian.d.foy@gmail.com> wrote in
news:200420081507550257%brian.d.foy@gmail.com:
> In article <fudqbu021qf@news4.newsguy.com>, szr
> <szrRE@szromanMO.comVE> wrote:
>
>> Jürgen Exner wrote:
>
>> > No. It is a different way of saying "If there is stuff after
>> > the last newline then that stuff doesn't constitute a proper
>> > line..."
>>
>> I don't recall there being any sort of rule saying a text file's
>> last character /has/ to be a line terminator, though I can see
>> how it would seem better formed if it does.
>
> There's no rule for it, but a lot of things expect it. Just
> Google "no newline at end of file" to see for yourelf.
AFAIK, the C standard requires lines in text files to be terminated
with the platform specific newline character sequence.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Mon, 21 Apr 2008 00:14:33 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: FAQ 5.3 How do I count the number of lines in a file?
Message-Id: <usmn0499nltfnmqh1qthpljlf52g2rq5ro@4ax.com>
"szr" <szrRE@szromanMO.comVE> wrote:
>I don't recall there being any sort of rule saying a text file's last
>character /has/ to be a line terminator,
Well, it's really the question of if the newline is a seperator or a
terminator.
If you consider it to be a line separator then you don't need a closing
newling.
If you consider it to be a line terminator, then a line without its
terminator wouldn't be well formed.
> though I can see how it would seem better formed if it does.
There are tools and even editors which won't work properly if the last
line is not terminated properly.
jue
------------------------------
Date: Mon, 21 Apr 2008 10:43:59 +0530
From: "Vakayil Thobias" <vakayil.thobias@alcatel-lucent.com>
Subject: floating bar in the line chart
Message-Id: <1208754849.888840@slbhw0>
Hello,
How can create a line chart with bar in the graph ?
I am using perl+win32
Thanks in advance.
Regards,
Thobias
------------------------------
Date: Mon, 21 Apr 2008 05:37:45 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: floating bar in the line chart
Message-Id: <r0ao04ljh7h0heke3mplt8ks1ktrifpkvd@4ax.com>
"Vakayil Thobias" <vakayil.thobias@alcatel-lucent.com> wrote:
>How can create a line chart with bar in the graph ?
What?
jue
------------------------------
Date: Mon, 21 Apr 2008 09:07:40 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: floating bar in the line chart
Message-Id: <672sq2F2m0qmbU1@mid.individual.net>
Vakayil Thobias wrote:
>
> How can create a line chart with bar in the graph ?
> I am using perl+win32
Did you take a look at CPAN?
http://search.cpan.org/search?query=graph%3A%3A*&mode=module&n=100
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Mon, 21 Apr 2008 13:50:04 +0530
From: "Vakayil Thobias" <vakayil.thobias@alcatel-lucent.com>
Subject: Re: floating bar in the line chart
Message-Id: <1208766016.986030@slbhw0>
"Jürgen Exner" <jurgenex@hotmail.com> wrote in message
news:r0ao04ljh7h0heke3mplt8ks1ktrifpkvd@4ax.com...
> "Vakayil Thobias" <vakayil.thobias@alcatel-lucent.com> wrote:
>>How can create a line chart with bar in the graph ?
>
> What?
>
> jue
I would like to draw line chart as well as bar chart in the same graph by
using perl in win32
------------------------------
Date: Mon, 21 Apr 2008 17:38:47 +0530
From: "Vakayil Thobias" <vakayil.thobias@alcatel-lucent.com>
Subject: Re: floating bar in the line chart
Message-Id: <1208779740.245867@slbhw0>
"Frank Seitz" <devnull4711@web.de> wrote in message
news:672sq2F2m0qmbU1@mid.individual.net...
> Vakayil Thobias wrote:
>>
>> How can create a line chart with bar in the graph ?
>> I am using perl+win32
>
> Did you take a look at CPAN?
>
> http://search.cpan.org/search?query=graph%3A%3A*&mode=module&n=100
>
> Frank
> --
> Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
> Anwendungen für Ihr Internet und Intranet
> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
I couldn't able to find out any module from the above link for displaying
multiple graph in one chart.
------------------------------
Date: Mon, 21 Apr 2008 15:16:35 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: floating bar in the line chart
Message-Id: <fui4en$2g7e$2@ns.felk.cvut.cz>
Vakayil Thobias wrote:
> "Frank Seitz" <devnull4711@web.de> wrote in message
> news:672sq2F2m0qmbU1@mid.individual.net...
>> Vakayil Thobias wrote:
>>>
>>> How can create a line chart with bar in the graph ?
>>> I am using perl+win32
>>
>> Did you take a look at CPAN?
>>
>> http://search.cpan.org/search?query=graph%3A%3A*&mode=module&n=100
>>
>> Frank
>> --
>> Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
>> Anwendungen für Ihr Internet und Intranet
>> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
>
> I couldn't able to find out any module from the above link for
> displaying multiple graph in one chart.
Tk::Axis is not good for you?
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)
Please reply to <petr AT practisoft DOT cz>
------------------------------
Date: Tue, 22 Apr 2008 09:13:20 +0530
From: "Vakayil Thobias" <vakayil.thobias@alcatel-lucent.com>
Subject: Re: floating bar in the line chart
Message-Id: <1208835812.416396@slbhw0>
"Petr Vileta" <stoupa@practisoft.cz> wrote in message
news:fui4en$2g7e$2@ns.felk.cvut.cz...
> Vakayil Thobias wrote:
>> "Frank Seitz" <devnull4711@web.de> wrote in message
>> news:672sq2F2m0qmbU1@mid.individual.net...
>>> Vakayil Thobias wrote:
>>>>
>>>> How can create a line chart with bar in the graph ?
>>>> I am using perl+win32
>>>
>>> Did you take a look at CPAN?
>>>
>>> http://search.cpan.org/search?query=graph%3A%3A*&mode=module&n=100
>>>
>>> Frank
>>> --
>>> Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
>>> Anwendungen für Ihr Internet und Intranet
>>> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
>>
>> I couldn't able to find out any module from the above link for
>> displaying multiple graph in one chart.
>
> Tk::Axis is not good for you?
> --
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your
> mail from another non-spammer site please.)
>
> Please reply to <petr AT practisoft DOT cz>
>
It can't draw line and bar chart together.
------------------------------
Date: Tue, 22 Apr 2008 15:54:48 GMT
From: zentara <zentara@highstream.net>
Subject: Re: floating bar in the line chart
Message-Id: <5c2s04dh6q7qu4cvpciga5fba4mthcldhi@4ax.com>
On Mon, 21 Apr 2008 10:43:59 +0530, "Vakayil Thobias"
<vakayil.thobias@alcatel-lucent.com> wrote:
>Hello,
>
>How can create a line chart with bar in the graph ?
>I am using perl+win32
>
>Thanks in advance.
>Regards,
>Thobias
>
You can make anything you want on a Tk::Canvas( or a similar widget
like Tk::Zinc, Goo::Canvas, etc).
Of course, you will have to do the work of making your own axis.
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Fri, 18 Apr 2008 16:17:33 -0700 (PDT)
From: "zoomcart.com" <screwmeblome@gmail.com>
Subject: Form Post
Message-Id: <40344780-16b5-4364-820f-b6490187ebe8@q1g2000prf.googlegroups.com>
Hello and thanks in advance for your help.
I have code below that posts form data to a perl cgi scripted shopping
cart and it works great on my mac/firefox browser, but it doesn't work
on ibm/netscape machines. what gives? apparently the data isn't being
recognized and so the cart defaults to it's home page.
<form name='submit3' action='http://my.com/cart.cgi' method='post'>
<input type='hidden' name='user' value='bighouse'>
<input type='hidden' name='item_name' value='My Product'>
<input type='hidden' name='item_number' value='001'>
<input type='hidden' name='item_price' value='3.95'>
<input type='hidden' name='item_weight' value='0'>
<input type='hidden' name='NOTAX' value=''>
<input type='hidden' name='DOWNLOAD' value='1001.zip'>
<input type='image' src='advertisement.gif' value='Buy and Download
Now' name='add_to_cart'>
</form>
------------------------------
Date: Mon, 21 Apr 2008 10:55:57 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Form Post
Message-Id: <480cb90d$0$33226$815e3792@news.qwest.net>
zoomcart.com wrote:
> Hello and thanks in advance for your help.
> I have code below that posts form data to a perl cgi scripted shopping
> cart and it works great on my mac/firefox browser, but it doesn't work
> on ibm/netscape machines. what gives? apparently the data isn't being
> recognized and so the cart defaults to it's home page.
> <form name='submit3' action='http://my.com/cart.cgi' method='post'>
[...]
> </form>
You're going to have to debug your cart.cgi script.
------------------------------
Date: Thu, 17 Apr 2008 16:06:56 -0700 (PDT)
From: "xahlee@gmail.com" <xahlee@gmail.com>
Subject: get quote enclosed field in a line
Message-Id: <c4c50034-2f90-42ce-82ca-8ba214d49ec9@d1g2000hsg.googlegroups.com>
is there a simple way in perl, python, or awk/shell/pipe, that gets
the user agent field in a apache log?
e.g. the typical line is like this:
189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /
Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org
"http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html" "Mozilla/
5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311
Firefox/2.0.0.13" "-"
I want the part: "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:
1.8.1.13) Gecko/20080311 Firefox/2.0.0.13".
Thanks.
Xah
xah@xahlee.org
=E2=88=91 http://xahlee.org/
=E2=98=84
------------------------------
Date: Fri, 18 Apr 2008 01:21:31 +0200
From: "Martin P. Hellwig" <xng@xs4all.nl>
Subject: Re: get quote enclosed field in a line
Message-Id: <4807dc10$0$25223$e4fe514c@dreader18.news.xs4all.nl>
xahlee@gmail.com wrote:
> is there a simple way in perl, python, or awk/shell/pipe, that gets
> the user agent field in a apache log?
>
> e.g. the typical line is like this:
>
> 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /
> Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org
> "http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html" "Mozilla/
> 5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311
> Firefox/2.0.0.13" "-"
>
> I want the part: "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:
> 1.8.1.13) Gecko/20080311 Firefox/2.0.0.13".
>
> Thanks.
>
> Xah
> xah@xahlee.org
> ∑ http://xahlee.org/
>
> ☄
Something like:
# cut -d '"' -f 6 < httpd-access.log
?
--
mph
------------------------------
Date: Thu, 17 Apr 2008 23:39:06 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: get quote enclosed field in a line
Message-Id: <Xns9A83C7E80850Fasu1cornelledu@127.0.0.1>
"xahlee@gmail.com" <xahlee@gmail.com> wrote in news:c4c50034-2f90-42ce-82ca-8ba214d49ec9@d1g2000hsg.googlegroups.com:
[ Replying only in clpm because I can only talk about Perl ]
> is there a simple way in perl
s/perl/Perl ;-)
> 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /
> Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933
> xahlee.org
> "http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html" "Mozilla/
> 5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311
> Firefox/2.0.0.13" "-"
>
> I want the part: "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:
> 1.8.1.13) Gecko/20080311 Firefox/2.0.0.13".
Simple.
#!/usr/bin/perl
use strict;
use warnings;
my $line = <<EOL;
189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /
Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org
"http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html" "Mozilla/
5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311
Firefox/2.0.0.13" "-"
EOL
# deal with any extra spacing and/or
# line breaks inserted in posting
$line =~ s/^\s+//;
$line =~ s/\s+$//;
$line =~ s/\s+/ /g;
if ( $line =~ /"([^"]+)" "[^"]+"\z/ ) {
print "User agent: $1\n";
}
__END__
C:\Temp> lp
User agent: Mozilla/ 5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Thu, 17 Apr 2008 23:35:45 -0700 (PDT)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: get quote enclosed field in a line
Message-Id: <a7e0397c-d26b-4158-b7ee-5555f9f2aa3b@k13g2000hse.googlegroups.com>
> xah...@gmail.com wrote:
> > is there a simple way in perl, python, or awk/shell/pipe, that gets
> > the user agent field in a apache log?
> Something like:
> # cut -d '"' -f 6 < httpd-access.log
> ?
> --
> mph
Doesn't it feel like autosplit mode never gets any run time?
perl -laF'"' -ne'print $F[5]' access_log
------------------------------
Date: Fri, 18 Apr 2008 19:17:39 +0200
From: Michael Tosch <eedmit@NO.eed.SPAM.ericsson.PLS.se>
Subject: Re: get quote enclosed field in a line
Message-Id: <fual3j$n99$1@deacx010.eed.ericsson.se>
xahlee@gmail.com wrote:
> is there a simple way in perl, python, or awk/shell/pipe, that gets
> the user agent field in a apache log?
>
> e.g. the typical line is like this:
>
> 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /
> Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org
> "http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html" "Mozilla/
> 5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.13) Gecko/20080311
> Firefox/2.0.0.13" "-"
>
> I want the part: "Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:
> 1.8.1.13) Gecko/20080311 Firefox/2.0.0.13".
>
> Thanks.
>
> Xah
> xah@xahlee.org
> ∑ http://xahlee.org/
>
> ☄
awk -F\" '{print $6}' httpd-access.log
awk -F\" 'NF>6{print $6}' httpd-access.log
--
Michael Tosch @ hp : com
------------------------------
Date: Fri, 18 Apr 2008 05:04:57 GMT
From: "Sean" <imfeaw5672@pacbell.net>
Subject: How can I share common data structures and constants
Message-Id: <ZZVNj.1948$pS4.178@newssvr13.news.prodigy.net>
Hi,
I use certain constants defined in has, array and simple variables over and
over in some of the modules I have written. I was wondering if there was a
"C like include file" in Perl.
Any help is greatly appreciated.
-Sean
------------------------------
Date: Fri, 18 Apr 2008 08:49:32 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: How can I share common data structures and constants
Message-Id: <66qujsF2likomU2@mid.individual.net>
Sean wrote:
>
> I use certain constants defined in has, array and simple variables over and
> over in some of the modules I have written. I was wondering if there was a
> "C like include file" in Perl.
Declare the variables with our and include the
file with use or require.
Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
------------------------------
Date: Thu, 17 Apr 2008 23:56:25 -0700 (PDT)
From: "Skye Shaw!@#$" <skye.shaw@gmail.com>
Subject: Re: How can I share common data structures and constants
Message-Id: <6f680205-ae7c-4801-b1cb-30888ce24546@a23g2000hsc.googlegroups.com>
On Apr 17, 10:04=A0pm, "Sean" <imfeaw5...@pacbell.net> wrote:
> Hi,
>
> I use certain constants defined in has, array and simple variables over an=
d
> over in some of the modules I have written. I was wondering if there was a=
> "C like include file" in Perl.
>
> Any help is greatly appreciated.
>
> -Sean
perldoc -f require
require is similar to include; well maybe a little smarter...
Though I think it's generally better to give them a namespace via a
package.
Like so:
package Ass::Bass;
our $GOOD_YEAR =3D 16;
our $CASS =3D 'what it izzz!';
1;
then use them like so:
use Ass::Bass;
print "Sorry franky... $Ass::Bass::GOOD_YEAR"
check out
perldoc -f package
perldoc -f our
-Skye
------------------------------
Date: Fri, 18 Apr 2008 03:08:53 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: How can I share common data structures and constants
Message-Id: <m1r6d3fxmi.fsf@dot-app.org>
"Sean" <imfeaw5672@pacbell.net> writes:
> I use certain constants defined in has, array and simple variables over and
> over in some of the modules I have written. I was wondering if there was a
> "C like include file" in Perl.
Yes - it's called modules. Given that you've already written some, I don't
understand what you're really asking here. What's stopping you from simply
placing your constants, etc. in a module and use()-ing it?
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Fri, 18 Apr 2008 00:39:46 -0700 (PDT)
From: rthangam <ramesh.thangamani@gmail.com>
Subject: Re: How can I share common data structures and constants
Message-Id: <65abad1f-e3c6-427f-8507-cef47e5f06fb@k37g2000hsf.googlegroups.com>
On Apr 18, 10:04 am, "Sean" <imfeaw5...@pacbell.net> wrote:
> Hi,
>
> I use certain constants defined in has, array and simple variables over and
> over in some of the modules I have written. I was wondering if there was a
> "C like include file" in Perl.
>
> Any help is greatly appreciated.
>
> -Sean
You can create a separate module for having all the constant values
like for example:
% cat Const.pm
package Const;
use constant
{
foo => 10,
bar => 23
};
1;
% cat const_test.pl
#! /usr/bin/perl
use Const;
print Const::foo;
This is one way i could think of there should be other ways too
------------------------------
Date: Fri, 18 Apr 2008 00:42:32 -0700 (PDT)
From: rthangam <ramesh.thangamani@gmail.com>
Subject: Re: How can I share common data structures and constants
Message-Id: <c07340d5-1486-49c6-af0a-57d576f9b6cc@b1g2000hsg.googlegroups.com>
On Apr 18, 10:04 am, "Sean" <imfeaw5...@pacbell.net> wrote:
> Hi,
>
> I use certain constants defined in has, array and simple variables over and
> over in some of the modules I have written. I was wondering if there was a
> "C like include file" in Perl.
>
> Any help is greatly appreciated.
>
> -Sean
You can have the constants as a hash in another module. Like for eg.,
% cat Const.pm
package Const;
use constant
{
foo => 10,
bar => 23
};
1;
% cat const_test.pl
#! /usr/bin/perl
use Const;
print Const::foo;
Here Const.pm has the constants which can be used by other files or
modules and also makes it easier to maintain
------------------------------
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 V11 Issue 1456
***************************************