[29982] in Perl-Users-Digest
Perl-Users Digest, Issue: 1225 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 23 06:09:42 2008
Date: Wed, 23 Jan 2008 03:09:05 -0800 (PST)
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 Jan 2008 Volume: 11 Number: 1225
Today's topics:
Re: Can't Install Perl as Non-Root <Dawmail333@gmail.com>
new CPAN modules on Wed Jan 23 2008 (Randal Schwartz)
Re: Newbie Perl Question (Bryce)
Re: Newbie Perl Question <jurgenex@hotmail.com>
Re: Newbie Perl Question (Bryce)
Re: Newbie Perl Question <RedGrittyBrick@SpamWeary.foo>
Re: Newbie Perl Question <noreply@gunnar.cc>
Perl and Qt4 <john@castleamber.com>
Re: sprintf rouding error Broki@gmx.de
Re: Variable interpolation and m in regular expression <josef.moellers@fujitsu-siemens.com>
Re: XML Reference problem <tadmc@seesig.invalid>
Re: XML results questions <1usa@llenroc.ude.invalid>
Re: XML results questions sharon@blue-linedesign.com
Re: XML results questions sharon@blue-linedesign.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 23 Jan 2008 00:15:21 -0800 (PST)
From: dawmail333 <Dawmail333@gmail.com>
Subject: Re: Can't Install Perl as Non-Root
Message-Id: <daf89c6a-6363-42cc-8ff9-e446ca8ed620@k2g2000hse.googlegroups.com>
On Jan 19, 5:12=A0pm, Ben Morrow <b...@morrow.me.uk> wrote:
> Quoth dawmail333 <Dawmail...@gmail.com>:
>
>
>
> > Hi!
>
> > I was trying to install a personal version of Perl to my own user
> > folder. =A0I am running on a remote webserver that uses Apache. =A0I hav=
e
> > succeeded with the following steps:
>
> > wgethttp://perl.com/CPAN/src/stable.tar.gz
> > tar zvxf stable.tar.gz
> > cd perl-5.8.8
> > sh Configure -de -Dprefix=3D/home/.bazooka/dawliam/perl/
>
> > This is the line I encounter problems on:
> > make && make test && make install
>
> > This is the 'dump':
> > Extracting find2perl (with variable substitutions)
>
> > make[1]: Leaving directory `/home/.bazooka/dawliam/perl-5.8.8/x2p'
>
> > =A0 =A0 =A0 =A0 Making B (dynamic)
> > opendir(./../../../../..): Permission denied at ../../lib/File/Find.pm
> > line 604
>
> File::Find is trying to work out its cwd, which means it needs to be
> able to readdir all the directories down from /. Do you not have read
> permission on /home?
>
> > Use of chdir('') or chdir(undef) as chdir() is deprecated at ../../lib/
> > File/Find
> > .pm line 751.
>
> This is a bug in File::Find. If it can't determine the cwd (and it
> really needs to) it should fail, not start randomly chdiring all over
> the place.
>
> The rest of the errors are a consequence of being in the wrong
> directory.
>
> Is it possible for you to build perl (not necessarily install perl) in a
> directory where you *can* read all the directories down from /? Perhaps
> /tmp, if there's enough room there? Otherwise, try 5.10.0, which has a
> newer version of Cwd that (at least on my machine) doesn't fail in the
> same way.
>
> Ben
I don't have read permissions in home, and I don't think I have write
in tmp either. Doesn't that get removed anyway?
I tried 5.10, and this is my new error.
make: *** [install] Error 2
[hyperion]$ make
AutoSplitting perl library
=2E/miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@ARGV)' lib/*.pm
=2E/miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@ARGV)' lib/*/*.pm
make lib/re.pm
make[1]: Entering directory `/home/.bazooka/dawliam/perl-5.10.0'
make[1]: `lib/re.pm' is up to date.
make[1]: Leaving directory `/home/.bazooka/dawliam/perl-5.10.0'
Making DynaLoader (static)
make[1]: Entering directory `/home/.bazooka/dawliam/perl-5.10.0/ext/
DynaLoader'
/bin/sh: line 1: /miniperl: No such file or directory
make[1]: *** [../../lib/.exists] Error 127
make[1]: Leaving directory `/home/.bazooka/dawliam/perl-5.10.0/ext/
DynaLoader'
make config failed, continuing anyway...
make[1]: Entering directory `/home/.bazooka/dawliam/perl-5.10.0/ext/
DynaLoader'
/bin/sh: line 1: /miniperl: No such file or directory
make[1]: *** [../../lib/.exists] Error 127
make[1]: Leaving directory `/home/.bazooka/dawliam/perl-5.10.0/ext/
DynaLoader'
make: *** [DynaLoader.o] Error 2
What the hell is going wrong now???
------------------------------
Date: Wed, 23 Jan 2008 05:42:16 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Wed Jan 23 2008
Message-Id: <Jv316G.127A@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
Algorithm-SVM-0.13
http://search.cpan.org/~lairdm/Algorithm-SVM-0.13/
Perl bindings for the libsvm Support Vector Machine library.
----
App-TimeTracker-0.06
http://search.cpan.org/~domm/App-TimeTracker-0.06/
Track time spend on projects from the commandline
----
Archive-Ipkg-0.04
http://search.cpan.org/~crenz/Archive-Ipkg-0.04/
Module for manipulation of iPKG archives
----
Class-DBI-Plugin-DeepAbstractSearchPager-0.04
http://search.cpan.org/~sriha/Class-DBI-Plugin-DeepAbstractSearchPager-0.04/
paged queries for CDBI::Plugin::DeepAbstractSearch
----
Class-MOP-0.52
http://search.cpan.org/~stevan/Class-MOP-0.52/
A Meta Object Protocol for Perl 5
----
Config-Nested-2.0.1
http://search.cpan.org/~arif/Config-Nested-2.0.1/
parse a configuration file consiging of nested blocks and sections.
----
DBIx-Transaction-1.002
http://search.cpan.org/~crakrjack/DBIx-Transaction-1.002/
Allow transactions to be nested in DBI
----
Data-Rand-Obscure-0.020
http://search.cpan.org/~rkrimen/Data-Rand-Obscure-0.020/
Generate (fairly) random strings easily.
----
Data-Types-0.07
http://search.cpan.org/~dwheeler/Data-Types-0.07/
Validate and convert data types.
----
Email-Fingerprint-0.15
http://search.cpan.org/~budney/Email-Fingerprint-0.15/
Calculate a digest for recognizing duplicate emails
----
ExtUtils-PkgConfig-1.09
http://search.cpan.org/~tsch/ExtUtils-PkgConfig-1.09/
simplistic interface to pkg-config
----
File-Assets-0.031
http://search.cpan.org/~rkrimen/File-Assets-0.031/
Manage .css and .js assets in a web application
----
File-Assets-0.032
http://search.cpan.org/~rkrimen/File-Assets-0.032/
Manage .css and .js assets in a web application
----
File-LinkTree-Builder-0.004
http://search.cpan.org/~rjbs/File-LinkTree-Builder-0.004/
builds a tree of symlinks based on file metadata
----
Finance-Bank-HSBC-1.04
http://search.cpan.org/~bisscuitt/Finance-Bank-HSBC-1.04/
Check your HSBC bank accounts from Perl
----
HTML-FormFu-0.02004
http://search.cpan.org/~cfranks/HTML-FormFu-0.02004/
HTML Form Creation, Rendering and Validation Framework
----
HTTP-MobileUID-0.01
http://search.cpan.org/~miyazaki/HTTP-MobileUID-0.01/
???????????ID?????
----
Jifty-Plugin-JapaneseNotification-0.01
http://search.cpan.org/~bokutin/Jifty-Plugin-JapaneseNotification-0.01/
Send emails from Jifty with Japanese character code
----
Language-Befunge-3.05
http://search.cpan.org/~jquelin/Language-Befunge-3.05/
a Befunge-98 interpreter
----
List-Parseable-1.01
http://search.cpan.org/~sbeck/List-Parseable-1.01/
routines to work with lists containing a simple language
----
Mail-Address-MobileJp-0.08
http://search.cpan.org/~miyagawa/Mail-Address-MobileJp-0.08/
mobile email address in Japan
----
Moose-0.35
http://search.cpan.org/~stevan/Moose-0.35/
A postmodern object system for Perl 5
----
Moose-Autobox-0.06
http://search.cpan.org/~stevan/Moose-Autobox-0.06/
Autoboxed wrappers for Native Perl datatypes
----
MooseX-App-Cmd-0.02
http://search.cpan.org/~nuffin/MooseX-App-Cmd-0.02/
Mashes up MooseX::Getopt and App::Cmd.
----
MooseX-Compile-0.01
http://search.cpan.org/~nuffin/MooseX-Compile-0.01/
Moose ? .pmc
----
MooseX-Compile-CLI-0.01
http://search.cpan.org/~nuffin/MooseX-Compile-CLI-0.01/
Command line interface for MooseX::Compile
----
MooseX-Getopt-0.09
http://search.cpan.org/~nuffin/MooseX-Getopt-0.09/
A Moose role for processing command line options
----
MooseX-Object-Pluggable-0.0007
http://search.cpan.org/~groditi/MooseX-Object-Pluggable-0.0007/
Make your classes pluggable
----
Net-Amazon-EC2-Metadata-0.10
http://search.cpan.org/~nmcfarl/Net-Amazon-EC2-Metadata-0.10/
Retrieves data from EC2 Metadata service. Both script and API; Works only from an EC2 instance.
----
Net-DNSBL-Monitor-0.02
http://search.cpan.org/~miker/Net-DNSBL-Monitor-0.02/
Monitor DNSBL response
----
Net-DNSBL-Statistics-0.04
http://search.cpan.org/~miker/Net-DNSBL-Statistics-0.04/
gather DNSBL Statistics
----
Net-MRIM-1.06
http://search.cpan.org/~aau/Net-MRIM-1.06/
Perl implementation of mail.ru agent protocol
----
POE-Component-Q4M-0.00002
http://search.cpan.org/~dmaki/POE-Component-Q4M-0.00002/
Access Q4M From POE
----
POE-Component-Server-SimpleSMTP-1.10
http://search.cpan.org/~bingos/POE-Component-Server-SimpleSMTP-1.10/
A simple to use POE SMTP Server.
----
POE-Filter-Stomp-0.03
http://search.cpan.org/~kesteb/POE-Filter-Stomp-0.03/
Perl extension for the POE Environment
----
Parley-0.58_14
http://search.cpan.org/~chisel/Parley-0.58_14/
Message board / forum application
----
Proc-Exists-0.07
http://search.cpan.org/~brianski/Proc-Exists-0.07/
quickly check for process existence
----
Proc-SafeExec-1.2
http://search.cpan.org/~bilbo/Proc-SafeExec-1.2/
Convenient utility for executing external commands in various ways.
----
Router-Statistics-0.99_985
http://search.cpan.org/~shamrock/Router-Statistics-0.99_985/
Router Statistics and Information Collection
----
SeeAlso-Server-0.48
http://search.cpan.org/~voj/SeeAlso-Server-0.48/
SeeAlso Linkserver Protocol Server
----
Socket-GetAddrInfo-0.08_4
http://search.cpan.org/~pevans/Socket-GetAddrInfo-0.08_4/
RFC 2553's getaddrinfo and getnameinfo functions.
----
Spreadsheet-Engine-0.14
http://search.cpan.org/~tmtm/Spreadsheet-Engine-0.14/
Core calculation engine for a spreadsheet
----
Statistics-Test-WilcoxonRankSum-0.0.2
http://search.cpan.org/~ingrif/Statistics-Test-WilcoxonRankSum-0.0.2/
perform the Wilcoxon (aka Mann-Whitney) rank sum test on two sets of numeric data.
----
Statistics-Test-WilcoxonRankSum-0.0.3
http://search.cpan.org/~ingrif/Statistics-Test-WilcoxonRankSum-0.0.3/
perform the Wilcoxon (aka Mann-Whitney) rank sum test on two sets of numeric data.
----
Test-FITesque-0.01
http://search.cpan.org/~konobi/Test-FITesque-0.01/
the FITesque framework!
----
Text-MultiMarkdown-1.0.9
http://search.cpan.org/~bobtfish/Text-MultiMarkdown-1.0.9/
Convert MultiMarkdown syntax to (X)HTML
----
Text-Tabulate-1.1.1
http://search.cpan.org/~arif/Text-Tabulate-1.1.1/
a pretty text data tabulator that minimises the width of tables.
----
Tk-Wizard-2.133
http://search.cpan.org/~lgoddard/Tk-Wizard-2.133/
GUI for step-by-step interactive logical process
----
Tk-Wizard-2.134
http://search.cpan.org/~lgoddard/Tk-Wizard-2.134/
GUI for step-by-step interactive logical process
----
Video-Xine-0.14
http://search.cpan.org/~stephen/Video-Xine-0.14/
Perl interface to libxine
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 23 Jan 2008 06:29:17 GMT
From: zerospam@example.com (Bryce)
Subject: Re: Newbie Perl Question
Message-Id: <19Blj.5472$Yl.2829@trnddc01>
On Tue, 22 Jan 2008 10:45:10 +0000, RedGrittyBrick wrote:
> I hope that helps.
I appreciate your response, and yes, your advice would normally be helpful. :-)
The problem is, I know nothing of Perl. I created the demonstration code in
my original post by falling back on my general knowledge of basic coding syntax,
and by gleaning hints from Perl code examples I discovered online. Admittedly,
that's a horrible way to write code. But when faced with performing a simple
task in a language one doesn't know, it sometimes works. ....and other times,
it doesn't. Like this time.
I hate asking others to write code for me. (I do learn the languages I'm most
often subject to.) Alas, asking for a free lunch was the essence of my plea in
this case. I assumed karma would excuse that, since this is only the second
time I've had to use -- and ask for help with -- Perl in five years.
> A '404 unavailable' response may not be appropriate - I'd review all the
> other documented 400-499 responses to see if any of them are more
> appropriate. You might want to use something like '403 Forbidden' instead.
You're correct, except that in this case, the goal is making the script appear
to not exist if hit by someone coming from anything other than the desired HTTP
Referer, or if no &url= parameter is provided. (I'll spare you the unamusing
story of why this corny deception is necessary.)
Thanks for the reply.
------------------------------
Date: Wed, 23 Jan 2008 07:13:29 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Newbie Perl Question
Message-Id: <b5qdp31td9tndo0op3qop0drrlo7rmv030@4ax.com>
zerospam@example.com (Bryce) wrote:
>You're correct, except that in this case, the goal is making the script appear
>to not exist if hit by someone coming from anything other than the desired HTTP
>Referer, or if no &url= parameter is provided. (I'll spare you the unamusing
>story of why this corny deception is necessary.)
Both of which can be faked trivially, of course.
jue
------------------------------
Date: Wed, 23 Jan 2008 10:34:39 GMT
From: zerospam@example.com (Bryce)
Subject: Re: Newbie Perl Question
Message-Id: <3LElj.18209$k15.2656@trnddc06>
Jürgen Exner wrote:
> zeros...@example.com (Bryce) wrote:
> >You're correct, except that in this case, the goal is making the script appear
> >to not exist if hit by someone coming from anything other than the desired HTTP
> >Referer, or if no &url= parameter is provided. (I'll spare you the unamusing
> >story of why this corny deception is necessary.)
>
> Both of which can be faked trivially, of course.
Of course. That's why I wouldn't be using this method if the Referer URL in
question were publicly known. Which it isn't.
------------------------------
Date: Wed, 23 Jan 2008 10:53:07 +0000
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Newbie Perl Question
Message-Id: <47971c97$0$21091$da0feed9@news.zen.co.uk>
Bryce wrote:
> Alas, asking for a free lunch was the essence of my plea in this case.
Shame on you.
#!/usr/bin/perl
use strict;
use warnings;
use CGI ':standard';
my $query = new CGI;
my $destination = $query->param("url");
my $origin = $ENV{'HTTP_REFERER'};
if ($destination ne '' && $origin =~ m(mysite\.com/thisurl\.php)) {
print redirect($destination);
} else {
print
header(-status => '404 Not Found'),
start_html('Page Not Found'),
h1('Page Not Found'),
p('Please ignore the man behind the curtain.'),
end_html();
}
Shame on me :-)
It's untested - if your free sandwich contains bugs, you're on your own.
------------------------------
Date: Wed, 23 Jan 2008 12:08:42 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Newbie Perl Question
Message-Id: <5volhrF1mjkaiU1@mid.individual.net>
Bryce wrote:
> I like helping myself and tried my best using tutorials to do this on my own.
> Alas, my attempts have failed. Nothing but 500 server errors. E.g.:
>
> #!/usr/bin/perl
> use CGI ':standard';
> $query = new CGI;
>
> $destination = $query->param("url")
> $origin = $ENV{'HTTP_REFERER'}
>
> if ($destination !eq '' && $origin =~ /mysite\.com\/thisurl\.php/) {
> print redirect($destination);
> } else {
> print "Status: 404 Not Found\n\n";
> }
Add this line to the beginning of the script, to get more useful error
messages displayed in the browser:
use CGI::Carp 'fatalsToBrowser';
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 23 Jan 2008 04:03:15 GMT
From: John Bokma <john@castleamber.com>
Subject: Perl and Qt4
Message-Id: <Xns9A2DE058CFE40castleamber@130.133.1.4>
I found some old (dead?) Qt for Perl project(s) and was wondering if there
is such a thing as Perl Qt4 bindings?
--
John
http://johnbokma.com/
------------------------------
Date: Wed, 23 Jan 2008 03:00:36 -0800 (PST)
From: Broki@gmx.de
Subject: Re: sprintf rouding error
Message-Id: <8dd83672-1f44-4e20-aaff-35d3c4ce478e@h11g2000prf.googlegroups.com>
Thanks again and again.
Another programmer gave me the hint to multiply with 100 (calculate in
cents)
and then divide and multiply only with integers, one after another.
(its the same as the hint of Mr. Holzer)
There are so many answers but as far as I can see, the problem is
minimized but not
solved completely due to the nature of at least the floating point
RESULT.
The programmer tried the same with Delphi an got correct result.
So I guess something like a library (like Math::Round) is used there
by default.
So, I have good advices for the future and see this case as closed for
my
point of view.
Thanks to the community!
G=F6tz
On 22 Jan., 19:23, "Peter J. Holzer" <hjp-usen...@hjp.at> wrote:
> On 2008-01-22 14:42, Joost Diepenmaat <jo...@zeekat.nl> wrote:
>
> > Br...@gmx.de writes:
> >> Thanks for your replies.
> >> To reduce the problem I will try to use expressions like 115/100 than
> >> 1.15.
>
> > If I understand you correctly, I think that won't make any
> > difference.
>
> It does in many cases, if used correctly.
>
> > I'm sure it won't once you assign 115/100 to a variable;
>
> That's the incorrect way :-).
>
> What I meant when I suggested that (and I think I already wrote that,
> but I probably wasn't clear enough), is to use terms like 115 / 100 in
> an expression:
>
> my $x =3D 5830;
> my $y =3D $x * 115 / 100;
>
> will first compute the product of 5830 and 115 (which is 670450) and
> then divide it by 100. The result is exactly 6704.5.
>
> my $y =3D $x * (115 / 100);
>
> will first compute 115 / 100: This is exactly representable in a finite
> binary number, so it is rounded (to 53 binary digits, usually). Then $x
> is divided by the rounded number, which is of course only approximately
> 6704.5.
>
> Variations like
>
> my $y =3D $x * 1.15;
>
> or
>
> my $z =3D 115 / 100;
> my $y =3D $x * $z;
>
> do the same, so they produce the same error.
>
> [...]
>
> >> What about the IEEE rounding and Perl...is it a fact that the
> >> "uncorrectness" with floating point conversion leads to the
> >> statistically interesting way to round 50% up/ 50% down?
>
> > For some sets of data, yes.
>
> If I understood the question correctly, no. The "statistically
> interesting way to round" is just a way to deal with the errors
> introduced by rounding in general. As the Wikipedia article mentions, it
> was already the recommended way of rounding in 1906 - long before
> computers. (Although it is true that if you used infinitely precise
> numbers and if your functions were all continous, the error would be
> infinitely small - so in a way it is the "uncorrectness of floating
> point numbers" which is the reason for the rule).
>
> =A0 =A0 =A0 =A0 hp
------------------------------
Date: Wed, 23 Jan 2008 09:13:26 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Variable interpolation and m in regular expression matching
Message-Id: <fn6sv9$78b$2@nntp.fujitsu-siemens.com>
J=FCrgen Exner wrote:
>>>So the RE matches the text 'word' followed by the content of $var
>>>interpreted as a RE.
>=20
>=20
> You may want to ignore this :-((
Ignore what? There's white space above your reply ;-)
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html
------------------------------
Date: Wed, 23 Jan 2008 02:34:20 GMT
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: XML Reference problem
Message-Id: <slrnfpcum2.98s.tadmc@tadmc30.sbcglobal.net>
sharon@blue-linedesign.com <sharon@blue-linedesign.com> wrote:
> I use an if statement with $xmlResults->{Ack} == "Success" and getting
> true instead of false.
That is what you are supposed to get (because zero does equal zero).
> I about to pull some hairs about and I don't have to many left, please
> help me save the last ones I have.
You should always enable warnings when developing Perl code!
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Wed, 23 Jan 2008 04:29:57 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: XML results questions
Message-Id: <Xns9A2DEF0AD8ADDasu1cornelledu@127.0.0.1>
sharon@blue-linedesign.com wrote in news:8e07a530-aa04-4db2-a574-
d10442feca48@u10g2000prn.googlegroups.com:
> Subject: XML results questions
...
> how can I find if the results are in an
> array or a hash?
You keep claiming that you have XML questions but your questions always
turn out to be basic language related questions.
You should check out the table of contents of Perl documentation installed
on your computer and read at least perlsyn, perldata, perlvar and perlfaq
for starters.
Then, you should take a look at perldsc and perlref at a minimum.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
------------------------------
Date: Tue, 22 Jan 2008 20:55:28 -0800 (PST)
From: sharon@blue-linedesign.com
Subject: Re: XML results questions
Message-Id: <65c19ab1-a99f-41cd-a4c9-e5ed2ecf2ffe@v4g2000hsf.googlegroups.com>
On Jan 22, 2:07 pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> nolo contendere wrote:
> > On Jan 22, 4:47 pm, sha...@blue-linedesign.com wrote:
> >> I'm retrieving an XML result from a website and the the result changes
> >> according to the number of Items returned.
> >> if only one item returned the XML use a hash to hold the name and
> >> value, however if more then one Item was returned it uses an Array to
> >> hold all the results.
> >> I'm trying to right a foreach statement to extract all the information
> >> and when I get one Item I get an error that this is not an Aray
> >> referance (which is obvius).
> >> does anyone have a seggestion, how can I find if the results are in an
> >> array or a hash?
>
> > Since you're dealing with references, this is easy.
>
> > There's a built-in function (ref) which does precisely this.
> > if ( ref($r) eq 'HASH' ) {
> > print "r is a reference to a hash.\n";
> > }
> > else if ( ref($r) eq 'ARRAY' ) {
> > print "\$r is an array ref.\n";
> > }
>
> In addition, if you're using XML::Simple, read the documentation for
> ForceArray.
Thanks for the tips
I appreciate it
------------------------------
Date: Tue, 22 Jan 2008 21:02:11 -0800 (PST)
From: sharon@blue-linedesign.com
Subject: Re: XML results questions
Message-Id: <228a4d1f-6cf0-4111-8ebc-56acca3bffb7@q77g2000hsh.googlegroups.com>
On Jan 22, 8:29 pm, "A. Sinan Unur" <1...@llenroc.ude.invalid> wrote:
> sha...@blue-linedesign.com wrote in news:8e07a530-aa04-4db2-a574-
> d10442fec...@u10g2000prn.googlegroups.com:
>
> > Subject: XML results questions
>
> ...
>
> > how can I find if the results are in an
> > array or a hash?
>
> You keep claiming that you have XML questions but your questions always
> turn out to be basic language related questions.
>
> You should check out the table of contents of Perl documentation installed
> on your computer and read at least perlsyn, perldata, perlvar and perlfaq
> for starters.
>
> Then, you should take a look at perldsc and perlref at a minimum.
>
> Sinan
>
> --
> A. Sinan Unur <1...@llenroc.ude.invalid>
> (remove .invalid and reverse each component for email address)
> clpmisc guidelines: <URL:http://www.augustmail.com/~tadmc/clpmisc.shtml>
Thanks for pointing me out to the documentation I'll definitely look
this up, I sure hope though that these suggestions come in good spirit
------------------------------
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 1225
***************************************