[28046] in Perl-Users-Digest
Perl-Users Digest, Issue: 9410 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 30 11:05:50 2006
Date: Fri, 30 Jun 2006 08:05:04 -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 Fri, 30 Jun 2006 Volume: 10 Number: 9410
Today's topics:
A question of speed <sigzero@gmail.com>
Re: A question of speed anno4000@zrz.tu-berlin.de
Re: A question of speed <sigzero@gmail.com>
Re: A question of speed <thepoet_nospam@arcor.de>
Re: A question of speed <tadmc@augustmail.com>
Re: Cam::PDF question <boss@gregerhaga.net>
Re: Cam::PDF question <LtCommander@gmail.com>
Re: Cam::PDF question <no@email.com>
Re: cgi/perl on Tomcat web server <bik.mido@tiscalinet.it>
How is this .cgi script achieved in Perl ?? ianv2@aol.com
Re: How is this .cgi script achieved in Perl ?? <bob@tclaboratories.com>
Re: Making the simple impossible and the impossible unt <bik.mido@tiscalinet.it>
Re: Perl Object Creation problem... <sgt19@tid.es>
Re: Perl Object Creation problem... <tadmc@augustmail.com>
Re: Professional IDE for a cross-platform Perl applicat <john@castleamber.com>
Re: Professional IDE for a cross-platform Perl applicat <tadmc@augustmail.com>
Re: Question on printerhandling <"v.niekerk at hccnet.nl">
Re: Question on printerhandling <rvtol+news@isolution.nl>
Re: Question on printerhandling <"v.niekerk at hccnet.nl">
Re: Question on printerhandling <wblock@wonkity.com>
Re: stuck in a while loop <tadmc@augustmail.com>
Re: test value <john@castleamber.com>
Re: test value <mol10metal@hotmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Jun 2006 05:38:56 -0700
From: "Robert Hicks" <sigzero@gmail.com>
Subject: A question of speed
Message-Id: <1151671136.666491.116210@i40g2000cwc.googlegroups.com>
I have some co-workers that are writing an email parser (not sure of
the specifics) that is going to process around 5000 emails a day. I
suggested that they go a pure Perl route but they are leary about Perl
being "fast" enough to parse that many emails.
I have no definitive experience with something on this scale but I am
sure someone on the Perl group does.
:Robert
------------------------------
Date: 30 Jun 2006 12:43:28 GMT
From: anno4000@zrz.tu-berlin.de
Subject: Re: A question of speed
Message-Id: <4gkkjgF1ns8qdU1@news.dfncis.de>
Robert Hicks <sigzero@gmail.com> wrote in comp.lang.perl.misc:
> I have some co-workers that are writing an email parser (not sure of
> the specifics) that is going to process around 5000 emails a day. I
> suggested that they go a pure Perl route but they are leary about Perl
> being "fast" enough to parse that many emails.
>
> I have no definitive experience with something on this scale but I am
> sure someone on the Perl group does.
5000 emails per day, that's 17 seconds per message. You can do a lot
of parsing in 17 seconds, even in Perl.
Anno
------------------------------
Date: 30 Jun 2006 05:46:56 -0700
From: "Robert Hicks" <sigzero@gmail.com>
Subject: Re: A question of speed
Message-Id: <1151671616.117972.144290@75g2000cwc.googlegroups.com>
anno4...@zrz.tu-berlin.de wrote:
> Robert Hicks <sigzero@gmail.com> wrote in comp.lang.perl.misc:
> > I have some co-workers that are writing an email parser (not sure of
> > the specifics) that is going to process around 5000 emails a day. I
> > suggested that they go a pure Perl route but they are leary about Perl
> > being "fast" enough to parse that many emails.
> >
> > I have no definitive experience with something on this scale but I am
> > sure someone on the Perl group does.
>
> 5000 emails per day, that's 17 seconds per message. You can do a lot
> of parsing in 17 seconds, even in Perl.
>
> Anno
That is what I was thinking, even if it was an 8 hour business day that
is still 5 seconds per message. Granted I don't know if that is a
steady influx or a deluge.
:Robert
------------------------------
Date: Fri, 30 Jun 2006 15:10:35 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: A question of speed
Message-Id: <44a522cc$0$29135$9b4e6d93@newsread4.arcor-online.net>
Robert Hicks wrote:
> anno4...@zrz.tu-berlin.de wrote:
>> Robert Hicks <sigzero@gmail.com> wrote in comp.lang.perl.misc:
>>> I have some co-workers that are writing an email parser (not sure of
>>> the specifics) that is going to process around 5000 emails a day. I
>>> suggested that they go a pure Perl route but they are leary about Perl
>>> being "fast" enough to parse that many emails.
>>>
>>> I have no definitive experience with something on this scale but I am
>>> sure someone on the Perl group does.
>> 5000 emails per day, that's 17 seconds per message. You can do a lot
>> of parsing in 17 seconds, even in Perl.
>>
> That is what I was thinking, even if it was an 8 hour business day that
> is still 5 seconds per message. Granted I don't know if that is a
> steady influx or a deluge.
I'm doing email filtering on a number of servers with roughly the same
amount of traffic, and even on old systems (P3-class) this runs
quite smoothly, even though there's a number of scripts and
external programs involved which pipe the mail content back and
forth. If your co-workers are still worried (maybe they expect
traffic to grow fast) they could build a threaded solution, which
would rid them of the most expensive part, which will be loading
of configuration items and the compilation and startup of the
script itself.
-Chris
------------------------------
Date: Fri, 30 Jun 2006 08:08:41 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: A question of speed
Message-Id: <slrneaa8ip.2k7.tadmc@magna.augustmail.com>
Robert Hicks <sigzero@gmail.com> wrote:
> I have some co-workers that are writing an email parser (not sure of
> the specifics) that is going to process around 5000 emails a day.
> I have no definitive experience with something on this scale
Perl generally works fine on a tiny scale such as you describe.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 30 Jun 2006 13:30:09 +0300
From: Greger <boss@gregerhaga.net>
Subject: Re: Cam::PDF question
Message-Id: <JR6pg.11720$Mh4.8353@reader1.news.jippii.net>
LtCommander wrote:
> Hi all,
>
> I am using the CAM::PDF module to extract text from PDF files. (It's an
> AMAZING module!!) You can pretty much do everything with it.
>
> My snippet for extracting text from a PDF file is:
>
> $pdf = CAM::PDF->new($Fil);
> $page = $pdf->getPageText($Pg);
>
> This works fine for all pages without any graphics. I am able to print
> the contents of $page without any problems whatsoever. However, if a
> particular page has some sort of an inline graphic, the $page returns
> an empty value!
>
> I was wondering:
> - If somebody knows how to remove all the graphics from the $pdf object
> before running the next line of code. I think that should fix it and no
> longer return any empty string.
>
> I've tried searching plenty but no luck so far!
>
> Would be grateful for your help.
>
> Vince
use PDF::API, available from cpan.
(I also tried CAM::PDF some while ago but pdf::api is better.)
--
Qx RSS Reader 1.2.6 released
RSS Reader for Linux.
http://www.gregerhaga.net/qxrssreader.php
------------------------------
Date: 30 Jun 2006 03:20:27 -0700
From: "LtCommander" <LtCommander@gmail.com>
Subject: Re: Cam::PDF question
Message-Id: <1151662827.224174.54170@x69g2000cwx.googlegroups.com>
Thanks a lot! I'll look into it.
Greger wrote:
> LtCommander wrote:
>
> > Hi all,
> >
> > I am using the CAM::PDF module to extract text from PDF files. (It's an
> > AMAZING module!!) You can pretty much do everything with it.
> >
> > My snippet for extracting text from a PDF file is:
> >
> > $pdf = CAM::PDF->new($Fil);
> > $page = $pdf->getPageText($Pg);
> >
> > This works fine for all pages without any graphics. I am able to print
> > the contents of $page without any problems whatsoever. However, if a
> > particular page has some sort of an inline graphic, the $page returns
> > an empty value!
> >
> > I was wondering:
> > - If somebody knows how to remove all the graphics from the $pdf object
> > before running the next line of code. I think that should fix it and no
> > longer return any empty string.
> >
> > I've tried searching plenty but no luck so far!
> >
> > Would be grateful for your help.
> >
> > Vince
> use PDF::API, available from cpan.
>
> (I also tried CAM::PDF some while ago but pdf::api is better.)
>
> --
> Qx RSS Reader 1.2.6 released
> RSS Reader for Linux.
> http://www.gregerhaga.net/qxrssreader.php
------------------------------
Date: Fri, 30 Jun 2006 12:30:27 +0100
From: Brian Wakem <no@email.com>
Subject: Re: Cam::PDF question
Message-Id: <4gkgajF1n77glU1@individual.net>
Greger wrote:
> LtCommander wrote:
>
>> Hi all,
>>
>> I am using the CAM::PDF module to extract text from PDF files. (It's an
>> AMAZING module!!) You can pretty much do everything with it.
>>
>> My snippet for extracting text from a PDF file is:
>>
>> $pdf = CAM::PDF->new($Fil);
>> $page = $pdf->getPageText($Pg);
>>
>> This works fine for all pages without any graphics. I am able to print
>> the contents of $page without any problems whatsoever. However, if a
>> particular page has some sort of an inline graphic, the $page returns
>> an empty value!
>>
>> I was wondering:
>> - If somebody knows how to remove all the graphics from the $pdf object
>> before running the next line of code. I think that should fix it and no
>> longer return any empty string.
>>
>> I've tried searching plenty but no luck so far!
>>
>> Would be grateful for your help.
>>
>> Vince
> use PDF::API, available from cpan.
>
> (I also tried CAM::PDF some while ago but pdf::api is better.)
I've always shelled out to pdftotext, I'll have a look at PDF::API too.
--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
------------------------------
Date: Fri, 30 Jun 2006 13:50:46 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: cgi/perl on Tomcat web server
Message-Id: <5l3aa29c8rp7tqqachd551drsm119d1aqm@4ax.com>
On 26 Jun 2006 06:27:18 -0700, narra.madan@gmail.com wrote:
>this is useful for others in this group who wants to do something
>different with perl..
It is useful for others in this group who want to do what you're doing
and are experiencing the same problems as yours at configuring a
specific web server.
Should you pause an instant and take a deep breath, you may realize
that the key point here is not "doing something different with perl"
but "doing something different with that particular web server".
Your question has nothing to do with perl code or even perl
installation, which would be on topic wrt perl. It's *upriver* of
perl.
Since perl is useful for web programming, and is often used in that
area, chances are that there may be some people here who could know
the answer to your question. This is not an excuse for not asking in
the most appropriate place, in the first place. Failing that, you may
ask here as a last resort, clearly underlining this circumstance.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 30 Jun 2006 05:22:04 -0700
From: ianv2@aol.com
Subject: How is this .cgi script achieved in Perl ??
Message-Id: <1151670124.407828.21140@75g2000cwc.googlegroups.com>
Hi
Does anybody know of an online availability checker script in perl
similar to the example at
http://catherinelouise.photolist.net/available.cgi
Or tutorials tht will show how to construct this?
Thanks
------------------------------
Date: 30 Jun 2006 06:08:58 -0700
From: "Bob Anastasia" <bob@tclaboratories.com>
Subject: Re: How is this .cgi script achieved in Perl ??
Message-Id: <1151672938.878963.268360@i40g2000cwc.googlegroups.com>
ianv2@aol.com wrote:
> Hi
>
> Does anybody know of an online availability checker script in perl
> similar to the example at
>
> http://catherinelouise.photolist.net/available.cgi
>
> Or tutorials tht will show how to construct this?
>
> Thanks
check here: http://cgi.resourceindex.com/
or here: http://www.scriptarchive.com/
or here: http://www.ezgoal.com/perlscripts/
or here: http://www.freeperlcode.com/
or here: http://www.perlarchive.com/
or here: http://www.scripts.com/
those should get you started. if those dont work out, you may want to
try somewhere to have someone make you a custom one.
------------------------------
Date: Fri, 30 Jun 2006 13:50:44 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Making the simple impossible and the impossible unthinkable...
Message-Id: <bk3aa2le0b8s6enq1h4go76c759jq0l6ge@4ax.com>
On 26 Jun 2006 12:34:02 -0700, xfx.publishing@gmail.com wrote:
>> Please put the subject of your article in the Subject of your article.
[snip]
>Well, potentially in my defence, the article is also abut stupidity,
>and the subject is, in fact, stupid!
You're potentially confusing stupidity with meta-stupidity. A post
*about* stupidity needs not a stupid Subject, which is better suited
to a stupid post, whereas yours is not.
And IMHO your Subject is not stupid either: it's a witty remark, but
it does not make a good Subject. It does a suboptimal one. It would
have been perfect for a "subtitle", though.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 30 Jun 2006 13:17:07 +0200
From: Stephan Titard <sgt19@tid.es>
Subject: Re: Perl Object Creation problem...
Message-Id: <e8317h$98g1@news.hi.inet>
howa escribió:
> Tad McClellan 寫道:
>
>> howa <howachen@gmail.com> wrote:
>>> lawre...@hummer.not-here.net ???
>>>
>>>> "howa" <howachen@gmail.com> writes:
>>>>> it seems a little stupid if the class name must be the package full
>>>>> name...
>>>>>
>>>> Perhaps this will offer enlightenement:
>>>>
>>>> Suppose I have two classes Road::Apple and Fruit::Apple
>>>>
>>>> #/usr/local/bin/howas-private-perl-like-language
>>>> use Road::Apple;
>>>> use Fruit::Apple;
>>>>
>>>> my $thing = new Apple;
>>>>
>>>> What kind of apple whould $thing be?
>>
>> I don't think that was a rhetorical question, but you did not
>> address it.
>>
>> What kind of apple whould $thing be?
>>
>>
>>>> One is delicious, the other not
>>>> so much.
>>
>> [snip .sig, you are not supposed to quote those you know]
>>
>>
>>> in other language, you also have this problem, java or c.
>> ^^^^
>>
>> What is with the "also" there?
>>
>> Perl does not have that problem.
>>
>>
>>> in fact, this is not a problem at all,
>>
>> Then what kind of apple whould $thing be?
>>
>> A red one or a brown one?
>>
>> If the programmer cannot tell, then it looks like a problem to me...
>>
>>
>> --
>> Tad McClellan SGML consulting
>> tadmc@augustmail.com Perl programming
>> Fort Worth, Texas
>
> did you even have experience on java or c? (no offense)
>
> how they handle namespace/package/import/include ?
>
> of coz perl has more then one way to do it, but seems the way how perl
> handle it is not a good solution.
>
hi, well
given a problem that could affect many languages the solution depends on
the language and it might even be that the problem disappears for some
language...
the import mecanism in java is there so that essentially you don't have
to type long names, in perl it is not really necessary
for example, the java snippet
import org.vln.*
VeryLongName v = new VeryLongName();
in perl
you save at least the lhs part ;)
my $v = org::vln::VeryLongName->new() ; # better to stick to the arrow...
Also from the point of view of explicit documentation/maintainability I
must prefer to use the full name.
anyway if you really want a short name you can use an alias
via one of the alias modules on CPAN
o use typeglob assignment (which you can read as a way of saying that 2
namespaces are equivalent)
*VLN = *Very::Long::Name;
in the context of OO I use it very little
preferring to hide this behing a module
now perl as a dynamic language has a lot more to offer
you can say
my $class = 'Very::Long::Name';
and
my $v = $class->new;
if you wish
o act on a series of classes
for my $class (@these_classes_that_do_survey_of_the worldcup)
{
my $watcher = $class->new();
$watcher->watch_football();
$watcher->save_result();
}
hth
--stephan
------------------------------
Date: Fri, 30 Jun 2006 07:40:07 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl Object Creation problem...
Message-Id: <slrneaa6t7.2gp.tadmc@magna.augustmail.com>
howa <howachen@gmail.com> wrote:
> Tad McClellan ???
>> [snip .sig, you are not supposed to quote those you know]
>> --
>> Tad McClellan SGML consulting
>> tadmc@augustmail.com Perl programming
>> Fort Worth, Texas
So long!
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Jun 2006 12:21:11 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Professional IDE for a cross-platform Perl application
Message-Id: <Xns97F24ACB52CF3castleamber@130.133.1.4>
"Bob" <catdogbeloved@yahoo.com> wrote:
> At this time, there is no separation between the actual application
> and the gui.
> I want to divide them. I also do not want to work by hand on another
> GUI.
> As stated above, I am searching for an integrated development
> environment
> that would take care of the GUI and its porting. I do not want to type
> code
> for the GUI, and debug it, and port it, and and and. I am done with
> that mess above.
Ah, yeah, the magical IDE. I think it's called outsourcing :-D
>> Porting from/to Linux/Windows works perfectly without changing any
>> Tk-related code. There is c.l.p.tk for perl-tk questions.
>
> Sorry, I am no longer interested in tk.
Nor in programming, so it seems.
I doubt if you will find an "IDE" that takes your Perl/TK application and
magically transforms it into a fast running cross platform product you
just have to plug some C into.
Probably best thing to do is reverse engineer it, and redesign it in a
language that matches todays requirements, and maybe for a few years to
come.
BTW, Perl *does* compile. But if you want it to compile to hide secrets,
you are mistaken. If you want to compile it to bundle it, have a look at
PAR. If you want to "compile" to speed things up: a close look at the code
might improve it.
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
------------------------------
Date: Fri, 30 Jun 2006 07:45:26 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Professional IDE for a cross-platform Perl application
Message-Id: <slrneaa776.2gp.tadmc@magna.augustmail.com>
Bob <catdogbeloved@yahoo.com> wrote:
> The first version was written in a DOS-based database. The
> unix-based perl/tk version is the latest of ports. The former
> was perl/cgi running under a web browser.
A Perl CGI program *never* runs under a browser.
CGI programs run on web *servers*.
> The application uses linux-specific features,
Then an IDE will not help in porting it.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 30 Jun 2006 12:11:28 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: Question on printerhandling
Message-Id: <44a4f8cf$0$8479$e4fe514c@dreader27.news.xs4all.nl>
> So it seems that your printing logic is already "on the next page". So
> why do you add the "\f"?
Because it is an attempt to position the printer on top of the next
page. Without the "\f", it is on the next page, but 6 lines from the top.
>
> Many HP Laser printer have by default 66 lines on a page. Of course you
> can send setup codes to it, to make that a lot more.
> But by default, after you have sent 66 lines, you will be on the next
> page already.
>
Should have mentioned this earlier: it's an HP DeskJet 520, very well
capable of printing ASCII. The old dBase code proves that, and I didn't
change the settings of the printer.
>
> I would let it print to a file, and check the special codes in the file.
>
That's an idea. Does Perl insert special or hidden codes?
------------------------------
Date: Fri, 30 Jun 2006 12:52:41 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Question on printerhandling
Message-Id: <e836s8.1ko.1@news.isolution.nl>
Huub:
> Without the "\f", it is on the next page, but 6 lines from the top.
66+6 is 72, so maybe dBase told the printer to accept 72 lines per page.
> Does Perl insert special or hidden codes?
No, but you haven't shown any code yet, so maybe you are. Or dBase was.
(Try to make the old dBase program print to a file as well, and diff the
results.)
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
Date: Fri, 30 Jun 2006 16:37:30 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: Question on printerhandling
Message-Id: <44a53409$0$9133$e4fe514c@dreader29.news.xs4all.nl>
Problem is solved: last empty lines of the page put into an
"if"-statement. Wonder why I didn't think of that earlier. Together with
the "\f" it's perfect.
Thank you for helping out.
------------------------------
Date: Fri, 30 Jun 2006 14:57:58 -0000
From: Warren Block <wblock@wonkity.com>
Subject: Re: Question on printerhandling
Message-Id: <slrneaaevm.1sod.wblock@speedy.wonkity.com>
Dr.Ruud <rvtol+news@isolution.nl> wrote:
> Huub:
>
>
>> Without the "\f", it is on the next page, but 6 lines from the top.
>
> 66+6 is 72, so maybe dBase told the printer to accept 72 lines per page.
60 lines per page is standard on lasers, at least with default fonts and
spacing. 66 is the old standard from impact printers, as in this case.
--
Warren Block * Rapid City, South Dakota * USA
------------------------------
Date: Fri, 30 Jun 2006 07:59:03 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: stuck in a while loop
Message-Id: <slrneaa80n.2gp.tadmc@magna.augustmail.com>
Nospam <nospam@home.com> wrote:
> Can anyone identify what is wrong with code,
What does it do? What do you want it to do instead?
> or worse how to fix it?,
^^^^^
Knowing how to fix it would be *better* than just pointing
out what was wrong.
> it
> worked one time, but not anymore, I have hardly made any changes
Then what is wrong is where you made the changes.
Where did you make the changes?
> use constant START => "<FILE2>";
Your program never uses this constant, so why is it there?
> my $START = <FILE2>;
> (my $varia1 = $START) =~ s/\@.*//;
$varia1 has a newline at the end. Is that what you want it to have?
> $mech->field('login',"$varia1");
^ ^
^ ^
perldoc -q vars
What's wrong with always quoting "$vars"?
> my @content1 = $content3;
How many elements are in the @content1 array?
> foreach my $content2 (@content1) {
A loop that iterates one time is not much of a loop.
> open (FILE, ">> hm5.txt");
You should always, yes *always*, check the return value from open().
> last;
> }
There is no need to exit "early" from a loop that only iterates
one time anyway...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 30 Jun 2006 12:15:40 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: test value
Message-Id: <Xns97F249DBAC8A3castleamber@130.133.1.4>
Josef Moellers <josef.moellers@fujitsu-siemens.com> wrote:
> John Bokma wrote:
>> Shane <shane@weasel.is-a-geek.net> wrote:
>>
>>
>>>I have some nasty code, that I want to check the value of something
>>>held in a scalar, but there is 'no' value held in there
>>>
>>>Data::Dumper tells me the $val = []
>>
>>
>> $val contains a reference to an empty array, like:
>>
>> my @array = ();
>> my $val = \@array;
>
> if (@$val == 0) {
> print "Empty\n";
> }
@$val or print "Empty\n";
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
------------------------------
Date: 30 Jun 2006 07:32:04 -0700
From: "Nick of course" <mol10metal@hotmail.com>
Subject: Re: test value
Message-Id: <1151677924.113274.163290@y41g2000cwy.googlegroups.com>
Shane wrote:
> I have some nasty code, that I want to check the value of something held in
> a scalar, but there is 'no' value held in there
>
> Data::Dumper tells me the $val = []
>
> How do I test for that?
>
> --
> Rule 6: There is no rule 6
>
> Blog: http://shanes.dyndns.org
if (ref $val eq 'ARRAY' && @$val == 0) { ... }
------------------------------
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 9410
***************************************