[23806] in Perl-Users-Digest
Perl-Users Digest, Issue: 6009 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 19:41:08 2004
Date: Thu, 29 Jan 2004 16:40:40 -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 Thu, 29 Jan 2004 Volume: 10 Number: 6009
Today's topics:
How To explicitly name a hash? <pdconetwofour_numbers_@yahoo.co.uk>
Re: How To explicitly name a hash? <uri@stemsystems.com>
Re: How To explicitly name a hash? <gnari@simnet.is>
Re: How To explicitly name a hash? <tadmc@augustmail.com>
How to get a listing of module functions <raisin@delete-this-trash.mts.net>
Re: How to get a listing of module functions <usenet@morrow.me.uk>
Re: How to get a listing of module functions <nobull@mail.com>
Re: how to get the table from a website and display <usenet@morrow.me.uk>
Re: how to get the table from a website and display <nospam@bigpond.com>
Re: how to get the table from a website and display (ajay)
Re: how to get the table from a website and display (Sara)
Re: how to get the table from a website and display <jwillmore@remove.adelphia.net>
Re: how to get the table from a website and display (ajay)
How to read the contents of the web page myhandle@lucent.com
Re: How to read the contents of the web page myhandle@lucent.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 25 Jan 2004 19:38:57 GMT
From: p cooper <pdconetwofour_numbers_@yahoo.co.uk>
Subject: How To explicitly name a hash?
Message-Id: <lXUQb.9431$PS3.101977353@news-text.cableinet.net>
Ive put the Mail::SendMail inot a subroutine and get a
sub mailsendmail{
my ($from, $to, $subject, $messagebody) = @_;
my @to_emails=qw(me@isp.com me@isp2.com me@isp3.com);
foreach $to(@to_emails)
{ %mail = ( To =>$to,
From =>$from,
Message => $messagebody);
}
}
[Sun Jan 25 20:37:09 2004] aagbi.pl: Name "main::mail" used only once:
possible typo at ./aagbi.pl line 110.
How do I explicitly name a hash ( form the mail::SendMail package) inside
the subroutine?
------------------------------
Date: Sun, 25 Jan 2004 20:44:36 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: How To explicitly name a hash?
Message-Id: <x78yjvwyfg.fsf@mail.sysarch.com>
>>>>> "pc" == p cooper <pdconetwofour_numbers_@yahoo.co.uk> writes:
pc> sub mailsendmail{
pc> my ($from, $to, $subject, $messagebody) = @_;
pc> my @to_emails=qw(me@isp.com me@isp2.com me@isp3.com);
pc> foreach $to(@to_emails)
pc> { %mail = ( To =>$to,
pc> From =>$from,
pc> Message => $messagebody);
pc> }
pc> }
you need to declare %mail with my.
also your code formatting can be improved. don't put code on the line
with foreach's {. i won't get into where to put that { (but it should be
on the foreach line :).
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Sun, 25 Jan 2004 20:19:42 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: How To explicitly name a hash?
Message-Id: <bv18ig$93s$1@news.simnet.is>
"p cooper" <pdconetwofour_numbers_@yahoo.co.uk> wrote in message
news:lXUQb.9431$PS3.101977353@news-text.cableinet.net...
> Ive put the Mail::SendMail inot a subroutine and get a
>
> sub mailsendmail{
> my ($from, $to, $subject, $messagebody) = @_;
> my @to_emails=qw(me@isp.com me@isp2.com me@isp3.com);
> foreach $to(@to_emails)
> { %mail = ( To =>$to,
> From =>$from,
> Message => $messagebody);
> }
> }
>
> [Sun Jan 25 20:37:09 2004] aagbi.pl: Name "main::mail" used only once:
> possible typo at ./aagbi.pl line 110.
>
> How do I explicitly name a hash ( form the mail::SendMail package) inside
> the subroutine?
The warning is just pointing out that you are setting the %mail hash to
different values, but not doing anything to them, which is not useful.
maybe you are forgetting a function call or something ?
gnari
------------------------------
Date: Sun, 25 Jan 2004 16:17:53 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How To explicitly name a hash?
Message-Id: <slrnc18g4h.ls4.tadmc@magna.augustmail.com>
p cooper <pdconetwofour_numbers_@yahoo.co.uk> wrote:
> Ive put the Mail::SendMail inot a subroutine and get a
There is no call to Mail::SendMail in the code you posted.
If you show us your (real) code, then we can help you debug it.
If you don't, then we can't.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 29 Jan 2004 11:13:00 -0600
From: Web Surfer <raisin@delete-this-trash.mts.net>
Subject: How to get a listing of module functions
Message-Id: <MPG.1a82fb13c4b05cc6989796@news.mts.net>
[This followup was posted to comp.lang.perl.misc]
I know that you can get a listing of all the modules that are installed
in your perl installation by doing something like this :
#!/usr/bin/perl -w
use ExtUtils::Installed;
my $inst = ExtUtils::Installed->new();
my @modules = $inst->modules();
$total = @modules;
print "$total modules detected\n\n";
print join("\n",@modules),"\n";
exit 0;
But, given this list of modules how can you determine the functions that
are "defined" in any one paticular module ?
------------------------------
Date: Thu, 29 Jan 2004 17:22:57 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to get a listing of module functions
Message-Id: <bvbfhh$7la$1@wisteria.csv.warwick.ac.uk>
Web Surfer <raisin@delete-this-trash.mts.net> wrote:
> [This followup was posted to comp.lang.perl.misc]
>
> I know that you can get a listing of all the modules that are installed
> in your perl installation by doing something like this :
>
> #!/usr/bin/perl -w
>
> use ExtUtils::Installed;
>
> my $inst = ExtUtils::Installed->new();
> my @modules = $inst->modules();
>
> $total = @modules;
> print "$total modules detected\n\n";
> print join("\n",@modules),"\n";
>
> exit 0;
Unnecessary.
> But, given this list of modules how can you determine the functions that
> are "defined" in any one paticular module ?
One way is to check the symbol table:
my $module = "Carp";
eval "require $module" or die $@;
{
no strict 'refs';
for (keys %{"${module}::"}) {
print if exists &{"${module}::$_"};
}
}
This won't find functions that are defined in some different package
from the module name.
Ben
--
Every twenty-four hours about 34k children die from the effects of poverty.
Meanwhile, the latest estimate is that 2800 people died on 9/11, so it's like
that image, that ghastly, grey-billowing, double-barrelled fall, repeated
twelve times every day. Full of children. [Iain Banks] ben@morrow.me.uk
------------------------------
Date: 29 Jan 2004 17:29:49 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: How to get a listing of module functions
Message-Id: <u9vfmuhdde.fsf@wcl-l.bham.ac.uk>
Web Surfer <raisin@delete-this-trash.mts.net> writes:
> [This followup was posted to comp.lang.perl.misc]
>
> I know that you can get a listing of all the modules that are installed
> in your perl installation by doing something like this :
>
> #!/usr/bin/perl -w
>
> use ExtUtils::Installed;
>
> my $inst = ExtUtils::Installed->new();
> my @modules = $inst->modules();
>
> $total = @modules;
> print "$total modules detected\n\n";
> print join("\n",@modules),"\n";
>
> exit 0;
>
>
> But, given this list of modules how can you determine the functions that
> are "defined" in any one paticular module ?
You look in the documentation. Why do you think that you could want
to know what functions are defined without knowing what they do?
Are you sure you meant to say "functions" not "packages"?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Tue, 27 Jan 2004 13:23:10 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: how to get the table from a website and display
Message-Id: <bv5onu$sg1$2@wisteria.csv.warwick.ac.uk>
ajay_kumarsingh@yahoo.com (ajay) wrote:
> hi all,
> http://www.startv.com/eng/op_ch_schedule.cfm?schannel_id=8&channel_id=8®ionid=5&langid=1&SDATE=21/01/2004
>
> I want to get this table/content and disply it/ or store it (or do
> anything)
>
> my question is hot to get this table/or any table ona web site by key
> here what i understand is
> key = schannel_id , value = 8
> &
> key regionid, value = 5
> & date
>
> how to do it in perl ?
perldoc LWP
perldoc URI
Ben
--
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/' # ben@morrow.me.uk
------------------------------
Date: Tue, 27 Jan 2004 23:23:33 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: how to get the table from a website and display
Message-Id: <bv5oqt$o38pk$1@ID-202028.news.uni-berlin.de>
ajay wrote:
> hi all,
> my question is hot
I'm sure it is.
First look at LWP::Simple
gtoomey
------------------------------
Date: 28 Jan 2004 03:56:37 -0800
From: ajay_kumarsingh@yahoo.com (ajay)
Subject: Re: how to get the table from a website and display
Message-Id: <2a0aec36.0401280356.245d5b26@posting.google.com>
Gregory Toomey <nospam@bigpond.com> wrote in message news:<bv5oqt$o38pk$1@ID-202028.news.uni-berlin.de>...
> ajay wrote:
>
> > hi all,
> > my question is hot
hot => HOW
>
> I'm sure it is.
>
> First look at LWP::Simple
>
> gtoomey
now this site uses Cold Fusion isn't it?
cgi i know how to do but cfm i don't know
any help ?
------------------------------
Date: 28 Jan 2004 06:08:34 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: how to get the table from a website and display
Message-Id: <776e0325.0401280608.fe8b9a4@posting.google.com>
ajay_kumarsingh@yahoo.com (ajay) wrote in message news:<2a0aec36.0401270445.5b4f1fc4@posting.google.com>...
> hi all,
> http://www.startv.com/eng/op_ch_schedule.cfm?schannel_id=8&channel_id=8®ionid=5&langid=1&SDATE=21/01/2004
>
> I want to get this table/content and disply it/ or store it (or do
> anything)
>
> my question is hot to get this table/or any table ona web site by key
> here what i understand is
> key = schannel_id , value = 8
> &
> key regionid, value = 5
> & date
>
> how to do it in perl ?
>
> my idea is to input the channel_id, region id and date and get the
> respective table to be displayed.
>
> Any detail help with code will be appreciated
>
> tx
> Ajay
AJ:
Not sure this is really a Perl question. Are you asking how to write
the cgi to post this data? If so you may be in the wrong place, but
the generally accepted method here is to use the good ole cgi Perl
module. And snag the data out of the field names in the form.
On the other hand if you're trying to get this table data from a
remote site, then try LWP::simple and parse it out of the text.
Regards and Buena Suerte,
Gx
------------------------------
Date: Wed, 28 Jan 2004 09:23:33 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: how to get the table from a website and display
Message-Id: <pan.2004.01.28.14.23.31.666370@remove.adelphia.net>
On Wed, 28 Jan 2004 03:56:37 -0800, ajay wrote:
> Gregory Toomey <nospam@bigpond.com> wrote in message
> news:<bv5oqt$o38pk$1@ID-202028.news.uni-berlin.de>...
>> ajay wrote:
>>
>> > hi all,
>> > my question is hot
> hot => HOW
>
>
>> I'm sure it is.
>>
>> First look at LWP::Simple
>>
>> gtoomey
>
>
> now this site uses Cold Fusion isn't it? cgi i know how to do but cfm i
> don't know any help ?
Huh?
It doesn't really matter what the site is using (except applets - LWP
doesn't do applets). If the site is rendered as HTML, then LWP should
work. There's even the LWP cookbook (`perldoc lwpcook`) to get you
started.
Put some code together, give it a try, and if it doesn't work, post again
(post as stated in our Posting Guidelines).
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Familiarity breeds attempt
------------------------------
Date: 29 Jan 2004 03:51:36 -0800
From: ajay_kumarsingh@yahoo.com (ajay)
Subject: Re: how to get the table from a website and display
Message-Id: <2a0aec36.0401290351.7dfe9566@posting.google.com>
genericax@hotmail.com (Sara) wrote in message news:<776e0325.0401280608.fe8b9a4@posting.google.com>...
> ajay_kumarsingh@yahoo.com (ajay) wrote in message news:<2a0aec36.0401270445.5b4f1fc4@posting.google.com>...
> > hi all,
> > http://www.startv.com/eng/op_ch_schedule.cfm?schannel_id=8&channel_id=8®ionid=5&langid=1&SDATE=21/01/2004
> >
> > I want to get this table/content and disply it/ or store it (or do
> > anything)
> >
> > my question is hot to get this table/or any table ona web site by key
> > here what i understand is
> > key = schannel_id , value = 8
> > &
> > key regionid, value = 5
> > & date
> >
> > how to do it in perl ?
> >
> > my idea is to input the channel_id, region id and date and get the
> > respective table to be displayed.
> >
> > Any detail help with code will be appreciated
> >
> > tx
> > Ajay
>
> AJ:
>
> Not sure this is really a Perl question. Are you asking how to write
> the cgi to post this data? If so you may be in the wrong place, but
> the generally accepted method here is to use the good ole cgi Perl
> module. And snag the data out of the field names in the form.
>
> On the other hand if you're trying to get this table data from a
> remote site, then try LWP::simple and parse it out of the text.
>
Yeh i want to achieve this one
> Regards and Buena Suerte,
> Gx
Tx all
------------------------------
Date: Fri, 23 Jan 2004 16:01:31 +0530
From: myhandle@lucent.com
Subject: How to read the contents of the web page
Message-Id: <4010F802.A0538419@lucent.com>
Hi All,
http://www.startv.com/eng/frame_schedule.cfm
I want to read the contents of this page.
Actually i want to write a perl script which will fetch the schedule of the
particular day.
I'll extend this script to fetch shcedule of any channel for any day.
To start with i have the follwoing simple script:
#!c:/perl/bin/perl.exe -w
use LWP::Simple;
getprint"http://www.startv.com/eng/frame_schedule.cfm";
when i run it ( on windows machine) i het the following error
500 Can't connect to www.startv.com:80 (connect: Unknown error)
<URL:http://www.startv.com/eng/frame_schedule.cfm>
I'm behind proxy
Any help
tx
------------------------------
Date: Fri, 23 Jan 2004 17:34:32 +0530
From: myhandle@lucent.com
Subject: Re: How to read the contents of the web page
Message-Id: <40110DD0.FF530455@lucent.com>
Solved :)
i forgot to specify proxy
$ENV{'http_proxy'} = 'http://my.proxy.int:8080';
the above line will work
myhandle@lucent.com wrote:
>
> Hi All,
>
> http://www.startv.com/eng/frame_schedule.cfm
>
> I want to read the contents of this page.
> Actually i want to write a perl script which will fetch the schedule of the
> particular day.
> I'll extend this script to fetch shcedule of any channel for any day.
> To start with i have the follwoing simple script:
>
> #!c:/perl/bin/perl.exe -w
> use LWP::Simple;
>
> getprint"http://www.startv.com/eng/frame_schedule.cfm";
>
> when i run it ( on windows machine) i het the following error
>
> 500 Can't connect to www.startv.com:80 (connect: Unknown error)
> <URL:http://www.startv.com/eng/frame_schedule.cfm>
>
> I'm behind proxy
>
> Any help
>
> tx
------------------------------
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 6009
***************************************