[22764] in Perl-Users-Digest
Perl-Users Digest, Issue: 4985 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 14 18:05:49 2003
Date: Wed, 14 May 2003 15:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 14 May 2003 Volume: 10 Number: 4985
Today's topics:
Re: @Array - making it null <uri@stemsystems.com>
[The/My] trouble with Perl <geenspam@geenspam.biz>
Re: [The/My] trouble with Perl (Malcolm Dew-Jones)
Re: [The/My] trouble with Perl (Randal L. Schwartz)
Re: [The/My] trouble with Perl (Randal L. Schwartz)
Re: dblib dbsqlexec return value <glex_nospam@qwest.net>
GD Graphics ... something strange <porter96@lycos.com>
Re: gotta be a better way <glex_nospam@qwest.net>
Re: gotta be a better way <krahnj@acm.org>
Re: gotta be a better way <usenet@dwall.fastmail.fm>
Re: gotta be a better way <wksmith@optonline.net>
Re: How to query a Microsoft SQL Server with perl? <usenet@dwall.fastmail.fm>
Re: Negating phrases (hymie!)
Re: newbie need help <krahnj@acm.org>
Re: newbie need help (Malcolm Dew-Jones)
Re: Perl, Xcopy on Windows, printing out results as we <ddunham@redwood.taos.com>
putting renamed array elements into a table (bryan)
SSL Post gives error (Tim)
System not returning exit code that I expected (Steve Canfield)
Re: System not returning exit code that I expected <uri@stemsystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 14 May 2003 18:44:19 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: @Array - making it null
Message-Id: <x7n0hpcqrh.fsf@mail.sysarch.com>
>>>>> "BL" == Bart Lateur <bart.lateur@pandora.be> writes:
BL> Balaji Venkataraman wrote:
>> So now that the experts say that undef is not a good thing to do, I
>> have a question.
BL> Experts say using undef() is not a good thing on arrays and hashes. No
BL> problem for scalars.
i said it isn't a problem for scalars but it is rarely needed with well
scoped declarations. my will initialize scalars to undef for you. now i just
see the explicit use of undef as a red flag. it means there should be a
better way to design the code than to use explicit undef calls.
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: Wed, 14 May 2003 21:48:31 +0200
From: Henk van Bree <geenspam@geenspam.biz>
Subject: [The/My] trouble with Perl
Message-Id: <3ec28f75$0$49117$e4fe514c@news.xs4all.nl>
**Let Perl 7 have a native GUI widget set!**
I need to draw a weird type of graph, so I tried to install Graph.pm.
This didn't go well, because it needed another version of GD.pm.
This didn't go well, because it needed another version of libgd.
This didn't go well, because it didn't like my version of freetype...
Maybe it's just me, but this happens almost every time I try to do
anything that is different from text-mode Perl scripting. A couple of months
ago I tried to get PerlQt working, same thing, dependencies of Smoke and
whatnot, all failing at some point.
I know good work is being done on Perl version 6, but may I input a
suggestion for Perl version 7:
**Let Perl 7 have a native GUI widget set!**
So far I've tried to get Qt, WxWindows, Gtk and/or Tk to work, with several
degrees of succes but it just doesn't work everytime.
Sure, I could maybe get it to work on my *development* machine, but at
deployment time the whole scene changes: Perl is nice and portable but I've
yet to see a (non-trivial) Perl GUI application working on GNU/Linux and
Windows from the same code-base. It just can't be done. Perhaps I'm just
not bright enough or maybe, just maybe the whole module circus is a wee bit
sucky.
So, I'll say it loud, I'll say it proud:
**Let Perl 7 have a native GUI widget set!**
Regards,
Henk
P.S. If I sound just a tad frustrated, that's maybe because I've spent
the better part of today not getting a single pixel plotted...
------------------------------
Date: 14 May 2003 12:30:31 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: [The/My] trouble with Perl
Message-Id: <3ec29957@news.victoria.tc.ca>
Henk van Bree (geenspam@geenspam.biz) wrote:
: Perl is nice and portable but I've
: yet to see a (non-trivial) Perl GUI application working on GNU/Linux and
: Windows from the same code-base.
I can't point to a publicly available application that does this, but if
you write your application in the form of a "private" web server where the
user is expected to use a browser to interact with the application, which
only responds, one page at a time, to a local client, then you have the
basis for a simple, yet fairly GUI perl application which can run most
anywhere.
You could use a full fledged web server if you wanted, but a single
threaded perl script running a few lines of lwp is all you need.
I don't quickly see an example of lwp to quote, but the outline is simple
(the networking should be configured to only talk to
a local client)
respond to first request with the welcome page
wait for more connects
switch on the requested page
if page = exit then end loop
other wise
run the appropriate perl subroutine to handle the
request and print a response page
end wait loop
display the good bye page
You might also wish to combine this with a few static html files. Either
the application serves them, or even easier, the browser can read them
directly.
------------------------------
Date: Wed, 14 May 2003 20:43:12 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: Henk van Bree <geenspam@geenspam.biz>
Subject: Re: [The/My] trouble with Perl
Message-Id: <09d507f2a2166e8ed527c2c9e0bc504f@TeraNews>
[comp.lang.perl deleted, as it has not been a valid newsgroup for
nearly a decade.]
>>>>> "Henk" == Henk van Bree <geenspam@geenspam.biz> writes:
Henk> **Let Perl 7 have a native GUI widget set!**
Henk> I need to draw a weird type of graph, so I tried to install Graph.pm.
Henk> This didn't go well, because it needed another version of GD.pm.
Henk> This didn't go well, because it needed another version of libgd.
Henk> This didn't go well, because it didn't like my version of freetype...
Yeah, the graphics libs are the toughest. GD, Gtk, Tk, PerlMagick.
All seem to require some sort of magical work to get working.
But it's not really Perl at fault here... the problem is the layering
of libraries, and moving (weekly? :) interfaces.
--
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, 14 May 2003 20:53:28 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: [The/My] trouble with Perl
Message-Id: <b2636730cbef5f60e27c057ed3d57e63@TeraNews>
Hmm. The venerable:
Henk van Bree <geenspam@geenspam.biz>
(1) posts to comp.lang.perl, a dead newsgroup
(2) sets the *followup* to said dead newsgroup
(3) spamcodes his email address
(4) doesn't give despamming instructions
That's probably worthy of a >PLONK< right there for those
with less time than I have to answer questions.
{sigh}
print "Just another Perl hacker,"
--
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, 14 May 2003 13:51:09 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: dblib dbsqlexec return value
Message-Id: <Iawwa.380$202.39071@news.uswest.net>
user@domain.invalid wrote:
>
> Im new to this so sorry if it doesnt make sence,
>
> I have the following code that calls Sybase using DBLib
>
> $dbh->dbcmd($sql);
> $rc1 = $dbh->dbsqlexec();
> if ( $rc1 == FAIL)
> {
> //do something
> }
>
> does $rc1 indicate that the function call worked or didnt work
> or (if applicable) the value returned from a stored procedure?
>
> is FAIL a DBLib variable or a Perl Variable?
DBLib
> is there something similar in DBI?
Of course. Check "perldoc DBI" and look for 'errstr'.
------------------------------
Date: Wed, 14 May 2003 13:21:45 -0500
From: "Steve" <porter96@lycos.com>
Subject: GD Graphics ... something strange
Message-Id: <vc529jp4n4v458@corp.supernews.com>
I use GD to draw some graphs. The background to the graph can be a variety
of colors. When the background is yellow, the graph line is black ...
otherwise the line is white.
When I use Netscape the colors come out fine. When I use Explorer however,
the graph line is always black. I did some trail and error and got it to
work OK regardless of the browser, but I was wondering ... why would a cgi
script care what browser I'm using?
Steve
------------------------------
Date: Wed, 14 May 2003 13:46:18 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: Re: gotta be a better way
Message-Id: <46wwa.379$202.38799@news.uswest.net>
rab wrote:
> I've had to resort to this:
>
>
> --------------------------------------
> foreach (<AFILE>) {
>
> push(@aim,$_) if /aim/;
> push(@ait3p,$_) if /ait3p/;
> push(@bsc3270,$_) if /bsc3270/;
> push(@cpmhs,$_) if /cpmhs/;
> push(@dkap,$_) if /dkap/;
> push(@ebim,$_) if /ebim/;
> push(@frm,$_) if /frm/;
> push(@msm,$_) if /msm/;
>
>
> } #end foreach my item
>
> if(@aim){foreach (@aim){print "$_\n";}}
> if(@ait3p){foreach (@ait3p){print "$_\n";}}
> if(@bsc3270){foreach (@bsc3270){print "$_\n";}}
> if(@cpmhs){foreach (@cpmhs){print "$_\n";}}
> if(@dkap){foreach (@dkap){print "$_\n";}}
> if(@ebim){foreach (@ebim){print "$_\n";}}
> if(@frm){foreach (@frm){print "$_\n";}}
> if(@msm){foreach (@msm){print "$_\n";}}
> -------------------------------------------------
>
> but I shouldn't do it that manually.... I **should** be able to
> complete all these repetitive tasks by using this (an array of the
> arrays) somehow:
>
> my @types=(\@aim,\@ait3p,\@bsc3270,\@cpmhs,\@dkap,\@ebim,\@frm,\@msm);
>
> but how!? I keep getting ARRAY(OxNNNNNNNN) references.
>
> some help?
You forgot the chunk of code you use to print out @types. You need
to loop through an array reference.
foreach my $type (@types)
{
foreach (@$type) { print "$_\n"; }
}
------------------------------
Date: Wed, 14 May 2003 19:18:13 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: gotta be a better way
Message-Id: <3EC2963D.203E1516@acm.org>
rab wrote:
>
> I've had to resort to this:
> --------------------------------------
> foreach (<AFILE>) {
>
> push(@aim,$_) if /aim/;
> push(@ait3p,$_) if /ait3p/;
> push(@bsc3270,$_) if /bsc3270/;
> push(@cpmhs,$_) if /cpmhs/;
> push(@dkap,$_) if /dkap/;
> push(@ebim,$_) if /ebim/;
> push(@frm,$_) if /frm/;
> push(@msm,$_) if /msm/;
>
>
> } #end foreach my item
>
> if(@aim){foreach (@aim){print "$_\n";}}
> if(@ait3p){foreach (@ait3p){print "$_\n";}}
> if(@bsc3270){foreach (@bsc3270){print "$_\n";}}
> if(@cpmhs){foreach (@cpmhs){print "$_\n";}}
> if(@dkap){foreach (@dkap){print "$_\n";}}
> if(@ebim){foreach (@ebim){print "$_\n";}}
> if(@frm){foreach (@frm){print "$_\n";}}
> if(@msm){foreach (@msm){print "$_\n";}}
> -------------------------------------------------
>
> but I shouldn't do it that manually.... I **should** be able to
> complete all these repetitive tasks by using this (an array of the
> arrays) somehow:
You could do it this way:
my @types = qw( aim ait3p bsc3270 cpmhs dkap ebim frm msm );
my $match = qr/\b(@{[join '|', @types]})\b/;
my %data;
while ( <AFILE> ) {
push @{ $data{ $1 } }, $_ if /$match/;
}
foreach my $type ( @data{ @types } ) {
print map "$_\n", @$type;
}
John
--
use Perl;
program
fulfillment
------------------------------
Date: Wed, 14 May 2003 19:24:58 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: gotta be a better way
Message-Id: <Xns937B9CD27EEEdkwwashere@216.168.3.30>
rab <unix@att.com> wrote:
> foreach (<AFILE>) {
The usual idiom is
while (<AFILE>) {
> push(@aim,$_) if /aim/;
> push(@ait3p,$_) if /ait3p/;
> push(@bsc3270,$_) if /bsc3270/;
> push(@cpmhs,$_) if /cpmhs/;
> push(@dkap,$_) if /dkap/;
> push(@ebim,$_) if /ebim/;
> push(@frm,$_) if /frm/;
> push(@msm,$_) if /msm/;
>} #end foreach my item
>
> if(@aim){foreach (@aim){print "$_\n";}}
> if(@ait3p){foreach (@ait3p){print "$_\n";}}
> if(@bsc3270){foreach (@bsc3270){print "$_\n";}}
> if(@cpmhs){foreach (@cpmhs){print "$_\n";}}
> if(@dkap){foreach (@dkap){print "$_\n";}}
> if(@ebim){foreach (@ebim){print "$_\n";}}
> if(@frm){foreach (@frm){print "$_\n";}}
> if(@msm){foreach (@msm){print "$_\n";}}
> but I shouldn't do it that manually.... I **should** be able to
> complete all these repetitive tasks by using this (an array of the
> arrays) somehow:
Use a hash, it will be easier:
use strict;
use warnings;
my %hash;
while (<AFILE>) {
if ( /(aim|ait3p|bsc3270|cpmhs|dkap|ebim|frm|msm)/ ) {
push @{$hash{$1}}, $_;
}
}
# close data file, etc
for my $key (sort keys %hash) {
print @{$hash{$key}};
}
------------------------------
Date: Wed, 14 May 2003 20:02:58 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: gotta be a better way
Message-Id: <Shxwa.3772$6L5.1642435@news4.srv.hcvlny.cv.net>
"rab" <unix@att.com> wrote in message
news:9bb5fc.0305140857.21f8c82f@posting.google.com...
> I've had to resort to this:
>
>
> --------------------------------------
> foreach (<AFILE>) {
>
> push(@aim,$_) if /aim/;
> push(@ait3p,$_) if /ait3p/;
> push(@bsc3270,$_) if /bsc3270/;
> push(@cpmhs,$_) if /cpmhs/;
> push(@dkap,$_) if /dkap/;
> push(@ebim,$_) if /ebim/;
> push(@frm,$_) if /frm/;
> push(@msm,$_) if /msm/;
>
>
> } #end foreach my item
>
> if(@aim){foreach (@aim){print "$_\n";}}
> if(@ait3p){foreach (@ait3p){print "$_\n";}}
> if(@bsc3270){foreach (@bsc3270){print "$_\n";}}
> if(@cpmhs){foreach (@cpmhs){print "$_\n";}}
> if(@dkap){foreach (@dkap){print "$_\n";}}
> if(@ebim){foreach (@ebim){print "$_\n";}}
> if(@frm){foreach (@frm){print "$_\n";}}
> if(@msm){foreach (@msm){print "$_\n";}}
> -------------------------------------------------
>
> but I shouldn't do it that manually.... I **should** be able to
> complete all these repetitive tasks by using this (an array of the
> arrays) somehow:
>
> my @types=(\@aim,\@ait3p,\@bsc3270,\@cpmhs,\@dkap,\@ebim,\@frm,\@msm);
>
> but how!? I keep getting ARRAY(OxNNNNNNNN) references.
>
> some help?
How about using arrays?
use strict;
use warnings;
my @pats = qr(aim ait3p bsc3270 cpmhs dkap ebim frm msm);
my @raw = <DATA>;
my @out = ();
foreach my $pat (@pats){
push @out, [grep $pat, @raw];
}
print @$_ foreach (@out);
__END__
aim1
2aim
msm3
4msm
Just one more way to do it.
Bill
------------------------------
Date: Wed, 14 May 2003 19:02:58 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Re: How to query a Microsoft SQL Server with perl?
Message-Id: <Xns937B991729F40dkwwashere@216.168.3.30>
Cartensy <cartensy@hotmail.com> wrote:
> Do I have to use Win32::OLE? Anybody has a exemple of a sample
> programm which connect an MSSQL server and execute un simple
> query?
I've always used DBI and DBD::ODBC. For example,
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect('DBI:ODBC:datasetname','user','password',
{RaiseError=>1} );
my $sth = $dbh->prepare("alter table Orders add Email char(100)")
or die "Can't prepare SQL statement: ", $dbh->errstr(), "\n";
my $rv = $sth->execute()
or die "Cannot execute SQL: ", $dbh->errstr(), "\n";
You'll have to create a DSN for the database, unless there's another
way to connect that I don't know about (very possible).
--
David Wall
------------------------------
Date: Wed, 14 May 2003 18:47:23 -0000
From: hymie@lactose.smart.net (hymie!)
Subject: Re: Negating phrases
Message-Id: <vc53prd5utllef@corp.supernews.com>
In our last episode, the evil Dr. Lacto had captured our hero,
Thomas Haselberger <thomas.haselberger@ucpmorgen.com>, who said:
>> print "$_\n" if /Name is [^Billy|^Fred]/;
^^^^^^^^^^^^^^
>This is a char class, matching one of the given chars.
>
>[^B] means match a char that is not B
>
>btw, I don't know what the second occurencs of ^ does.
When a ^ is not the first character after the opening bracket, then it
has no special meaning, it is simply another character in the class.
hymie! http://www.smart.net/~hymowitz hymie@lactose.smart.net
===============================================================================
------------------------------
Date: Wed, 14 May 2003 19:39:53 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: newbie need help
Message-Id: <3EC29B48.D65D75AF@acm.org>
Peng Zhao wrote:
>
> I have to process some huge files containing following lines:
>
> time event source
> ---------------------------------------------
> ...
> 11.322490 GET_PAGE _o2831/1133 200
> 11.330820 GET_PAGE _o2820/1122 200
> 11.476960 GET_PAGE _o2438/740 200
> 11.491210 GET_PAGE _o2711/1013 200
> 11.502060 GET_PAGE _o2536/838 200
> 13.048310 GET_PAGE _o2887/1189 200
> 13.054010 GET_PAGE _o2582/884 200
> 13.073399 REQUEST_DONE _o2711/1013 7 191989
> 13.182151 REQUEST_DONE _o2831/1133 6 722069
> 13.347800 GET_PAGE _o1731/33 200
> 13.554530 GET_PAGE _o2427/729 200
> 13.630060 REQUEST_DONE _o2536/838 4 408025
> 13.652410 GET_PAGE _o2619/921 200
> 13.654830 GET_PAGE _o2661/963 200
> 13.683290 GET_PAGE _o2648/950 200
> ...
>
> one of the task I want to do is to output the time difference between
> GET_PAGE and REQUEST_DONE from the same source.
> as they are huge files, I have to process it line by line.
>
> Is there an easy way to do it without keeping all sources in an array ?
I assume you only want to use the ones where event is REQUEST_DONE.
my %data;
my @found;
while ( <DATA> ) {
my ( $time, $event, $source ) = unpack 'A16 A16 A16', $_;
if ( $event eq 'GET_PAGE' ) {
$data{ $source } = $time;
}
elsif ( $event eq 'REQUEST_DONE' ) {
$data{ $source } = $time - $data{ $source };
push @found, $source;
}
}
for ( @found ) {
print "$_ $data{$_}\n";
}
__DATA__
11.322490 GET_PAGE _o2831/1133 200
11.330820 GET_PAGE _o2820/1122 200
11.476960 GET_PAGE _o2438/740 200
11.491210 GET_PAGE _o2711/1013 200
11.502060 GET_PAGE _o2536/838 200
13.048310 GET_PAGE _o2887/1189 200
13.054010 GET_PAGE _o2582/884 200
13.073399 REQUEST_DONE _o2711/1013 7 191989
13.182151 REQUEST_DONE _o2831/1133 6 722069
13.347800 GET_PAGE _o1731/33 200
13.554530 GET_PAGE _o2427/729 200
13.630060 REQUEST_DONE _o2536/838 4 408025
13.652410 GET_PAGE _o2619/921 200
13.654830 GET_PAGE _o2661/963 200
13.683290 GET_PAGE _o2648/950 200
John
--
use Perl;
program
fulfillment
------------------------------
Date: 14 May 2003 13:04:08 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: newbie need help
Message-Id: <3ec2a138@news.victoria.tc.ca>
Peng Zhao (peng.zhao@epfl.ch) wrote:
: hi folks,
: I have to process some huge files containing following lines:
: time event source
: ---------------------------------------------
: ...
: 11.322490 GET_PAGE _o2831/1133 200
: 11.330820 GET_PAGE _o2820/1122 200
: 11.476960 GET_PAGE _o2438/740 200
: 11.491210 GET_PAGE _o2711/1013 200
: 11.502060 GET_PAGE _o2536/838 200
: 13.048310 GET_PAGE _o2887/1189 200
: 13.054010 GET_PAGE _o2582/884 200
: 13.073399 REQUEST_DONE _o2711/1013 7 191989
: 13.182151 REQUEST_DONE _o2831/1133 6 722069
: 13.347800 GET_PAGE _o1731/33 200
: 13.554530 GET_PAGE _o2427/729 200
: 13.630060 REQUEST_DONE _o2536/838 4 408025
: 13.652410 GET_PAGE _o2619/921 200
: 13.654830 GET_PAGE _o2661/963 200
: 13.683290 GET_PAGE _o2648/950 200
: ...
: one of the task I want to do is to output the time difference between
: GET_PAGE and REQUEST_DONE from the same source.
: as they are huge files, I have to process it line by line.
: Is there an easy way to do it without keeping all sources in an array ?
You could sort the lines on source and event. Then each time you read a
line it is either a new GET_PAGE line, or the corresponding REQUEST_DONE
line.
------------------------------
Date: Wed, 14 May 2003 19:33:04 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: Perl, Xcopy on Windows, printing out results as we go
Message-Id: <QRwwa.951$Ec2.82521290@newssvr21.news.prodigy.com>
Jim B <jigidyjim@aol.com> wrote:
> Hey there -
> I've got Active Perl 5.6.1 and am running on Windows 2000. I've got a
> perl script that does a big recursive xcopy and copies a lot of files
> over. I am running the xcopy like
> system( "xcopy /d /i /s /r /y /f @ARGV[0]\\mydir\\*.* @ARGV[1]" );
Hmm. Is something else happening? I'm unable to reproduce this..
C:\> type test.pl
system ("xcopy /d /i /s /r /y /f c:\\TEMP c:\\TEMP2");
C:\> perl test.pl
[output comes through]
> now, when i run xcopy straight from windows (in a .bat file or
> something) it prints out each file as it copies it. However, the perl
> script prints out the whole thing at the very end.
Can you trim your script to just this one line and see if the same thing
happens? It sounds like STDOUT buffering, but that won't normally
happen with a system() like this, since perl isn't handling the output.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
------------------------------
Date: 14 May 2003 13:19:06 -0700
From: lepore@brandeis.edu (bryan)
Subject: putting renamed array elements into a table
Message-Id: <dc6e7ce5.0305141219.7528f011@posting.google.com>
i have an array, and using a loop i modified each element ($element_1,
etc.) by doing ($element_1_alternate = 1+$element_1). i can get the
original elements into a table i made outside the loop, but not the
modified ones. the modified elements are in fact calculated
correctly, but it looks like they only exist within the loop or
something.
i am stuck - it looks like it should work, but zeroes show up in the
table instead. i do get warnings about the modified elements being
used only once, i presume from the table - so the loop isn't getting
parsed or something. i can imagine some complex things to try to fix
this, but i figured i'd ask the group first.
-bryan
------------------------------
Date: 14 May 2003 13:03:14 -0700
From: tim_keane_1999@yahoo.com (Tim)
Subject: SSL Post gives error
Message-Id: <fb1f6143.0305141203.4993f7fc@posting.google.com>
I am pretty new at Perl and I get the following error when trying to
run the script below:
Can't call method "clone" on unblessed reference at
/usr/lib/perl5/site_perl/HTTP/Message.pm line 53.
----Begin Script----
#!/usr/bin/perl
################################################################################
use LWP::UserAgent;
use HTTP::Request::Common;
my $ua = LWP::UserAgent->new(env_proxy => 1,
keep_alive => 1,
timeout => 30);
my $request = HTTP::Request->new('POST',
'https://payflowlink.verisign.com/payflowlink.cfm',
[
LOGIN => 'timmay2k',
PARTNER => 'VeriSign',
ORDERFORM => 'False',
TYPE => 'S',
METHOD => 'CC',
CARDNUM => '4111111111111111',
CSC => '123',
EXPDATE => '072003',
AMOUNT => '10',
NAME => 'Tim Test',
ADDRESS => '123 Street',
CITY => 'Forest Hills',
STATE => 'NY',
ZIP => '11375',
COUNTRY => 'US',
EMAIL => 'tim_keane_1999@yahoo.com'
]);
my $response = $ua->request($request);
my $content = $response->content;
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "</head>\n";
print "<body>\n";
print "$content\n";
print "</body>\n";
print "</html>\n";
----End Script----
Any and all ideas are appreciated...
Thanks, Tim
------------------------------
Date: 14 May 2003 11:34:21 -0700
From: canfieldsteve@hotmail.com (Steve Canfield)
Subject: System not returning exit code that I expected
Message-Id: <cfb3b140.0305141034.4b7086e7@posting.google.com>
My understanding of the system() command is obviously insufficient.
As I understood it, system() returns the exit code of the program it
called. However, when I call a program that exits with, say, 1, then
system() returns 256. For 2, system returns 512. Etc.
Why does system return numbers like this? How can I find out the
"real" exit codes?
Steve
------------------------------
Date: Wed, 14 May 2003 18:57:29 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: System not returning exit code that I expected
Message-Id: <x7he7xcq5i.fsf@mail.sysarch.com>
>>>>> "SC" == Steve Canfield <canfieldsteve@hotmail.com> writes:
SC> My understanding of the system() command is obviously insufficient.
SC> As I understood it, system() returns the exit code of the program it
SC> called. However, when I call a program that exits with, say, 1, then
SC> system() returns 256. For 2, system returns 512. Etc.
SC> Why does system return numbers like this? How can I find out the
SC> "real" exit codes?
it is right there in the docs. read perldoc -f system and see what it
says is the return value.
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: 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.
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 4985
***************************************