[22962] in Perl-Users-Digest
Perl-Users Digest, Issue: 5182 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 5 09:05:44 2003
Date: Sat, 5 Jul 2003 06:05:08 -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 Sat, 5 Jul 2003 Volume: 10 Number: 5182
Today's topics:
Re: [Q] all installed modules <REMOVEsdnCAPS@comcast.net>
Re: Confused with array and references <REMOVEsdnCAPS@comcast.net>
Re: Confused with array and references <abigail@abigail.nl>
dynamic sorting (ARAVIND)
Re: dynamic sorting <bigj@kamelfreund.de>
Re: dynamic sorting <nanae@perusion.com>
Re: file opening grazz@pobox.com
How can I analyse jpg file with perl? <gamelifes@yahoo.com.cn>
Re: How can I analyse jpg file with perl? <no-email@aol.com>
Re: How can I analyse jpg file with perl? <gamelifes@yahoo.com.cn>
naming hash using a variable name. (ARAVIND)
Re: naming hash using a variable name. <nanae@perusion.com>
Re: newbie needs to globally edit his site (Joe Smith)
Re: Open URL from email message <beable+unsenet@beable.com.invalid>
Re: problem with Tk800.023.tar.gz from CPAN <kalinabears@hdc.com.au>
Re: Problems with perlcc <kalinabears@hdc.com.au>
reading header? results from another script <requests@zipperpulls.com>
thumbnail displaying main pic in new window <david.selby@wanadoo.fr>
Re: thumbnail displaying main pic in new window <wgu_@_wurquhart.co.uk>
Re: trying to parse XML from an email... (Joe Smith)
Re: What are 'Perl 5 style templates'? (Joe Smith)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 05 Jul 2003 06:51:37 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: [Q] all installed modules
Message-Id: <Xns93AF4FF62C779sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
inwap@inwap.com (Joe Smith) wrote in news:uLrNa.221$603.12107@iad-
read.news.verio.net:
> In article <zMLMa.1063$7y2.23763@tornado.fastwebnet.it>,
> Mattia <mattia.c@libero.it> wrote:
>>Does anyone know how to get a list of all intelled modules that are
>>available to be USEd?
...
> If that does not work, you could do this:
>
> perl -e '@a = grep /perl/,@INC; system "ls -lR @a"'
> -Joe
What, perl only looks for modules in those directories in @INC which have
"perl" somewhere in the path?
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwa7wmPeouIeTNHoEQKGiACg7nneANwxSqhUbR8NwYVTH5Asq/4AoIGh
svxhxcrgbVVVqGSoPC42vPWA
=WSXY
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 05 Jul 2003 06:49:10 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: Confused with array and references
Message-Id: <Xns93AF4F8C3396sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Kasp" <kasp@epatra.com> wrote in
news:be3qka$l1u$1@newsreader.mailgate.org:
> my $x = (5,6,7);
> print "$x\n";
> my $arrayRef = [1,2,3,['d','g','z']];
> print "$arrayRef->[3][1]\n";
> my $arrayRef2 = [1,2,3,('d','g','z')];
> print "$arrayRef2->[3]\n";
>
> The output is :
> $ perl ref.pl
> Useless use of a constant in void context at ref.pl line 4.
> Useless use of a constant in void context at ref.pl line 4.
> 7
> g
> d
> Now these are some doubts I have:
> 1. (5,6,7) represents an array, while [5,6,7] represents an array
> reference. Am I right?
Partly. [5,6,7] represents an anonymous array reference; that part is
right. (5,6,7) can be several things, depending on where you see it.
One of the things it can NOT be is an array.
It can be a list: @a = (5, 6, 7);
It can be arguments to a function: myfunc(5, 6, 7);
It can be an expression with two comma operators: $x = (5, 6, 7);
What you're seeing is the third. (If you are a C programmer,
incidentally, this is how C would interpret x = (5, 6, 7) too).
The comma operator is sometimes used to perform more than one action in a
single statement; for example:
$x = 5, $y = 7, next if $some_condition;
In the statement $x = (5, 6, 7), $x gets the value of the expression.
The value of an expression involving the comma operator is the last sub-
expression. In this case, 7. Since the other two sub-expressions (5,6)
have no side effects, Perl warns about the uselessness of the situation.
In general, however, remember this: (5, 6, 7) is a *list* when used in
"list context" (ie, where Perl expects a list. It's not an array. An
array is essentially a variable that can contain a list. Lists and
arrays behave the same for the most part, except in certain situations
such as in scalar context or when passing them to a function that
(because of its prototype) expects an array, or taking a reference via
the backslash operator.
> 2. The warning that I get : "Useless use of a constant in void context
> at ref.pl line 4." is beacuase I am assigning the array (5,6,7) to $x
> - a sscalar. The two warning messages are coming as 5 and 6 are being
> used unnecessarily. An assignment of scalar to an array will assign
> the last element of the array to the scalar ie 7 in this case.
ITYM "an assignment of an array to a scalar".
Now you know that (5, 6, 7) is not an array. If you had assigned an
array to a scalar, like $x = @a, $x would have been assigned the length
of the array (that is, the number of items in it).
> 3. In my $arrayRef2 = [1,2,3,('d','g','z')];.........how can I print
> 'g' ?
In this statement, ('d', 'g', 'z') is a list, not an array. Also in this
statement, 1, 2, 3 is a list. So now you see that parentheses are not
necessary for a list, and parentheses do not necessarily mean a list.
This is something that many new perl programmers have difficulty with.
Since 1, 2, 3 and ('d', 'g', 'z') are adjacent lists in a list context,
perl moooshes them together into one long list. So your statement does
not create a reference to an array with three scalar elements and one
array element, it creates a reference to an array with six scalar
elements, just as if you had typed:
[1, 2, 3, 'd', 'g', 'z']
If you want to nest data structures, the key point to remember is: Perl
cannot store anything into a single array element (or hash value) other
than a scalar. So if you want to have an array within an array, you
can't. A *reference* to an array, however, is a scalar. And you already
know how to make an array reference. So here's what you want:
$arrayRef = [1, 2, 3, ['d', 'g', 'z']];
Once you have that, you were correctly dereferencing it as:
> print "$arrayRef->[3][1]\n";
- --
Eric
$_ = reverse sort qw p ekca lre Js reh ts
p, $/.r, map $_.$", qw e p h tona e; print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPwa7NWPeouIeTNHoEQKN6gCg3pLQuHNrZ1rExjljgKXG5sdSfrcAn1Zz
8ge6nmH6i5/Bz3TedjLuw0sq
=ZWUb
-----END PGP SIGNATURE-----
------------------------------
Date: 05 Jul 2003 12:08:46 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Confused with array and references
Message-Id: <slrnbgdfud.s8m.abigail@alexandra.abigail.nl>
Eric J. Roode (REMOVEsdnCAPS@comcast.net) wrote on MMMDXCV September
MCMXCIII in <URL:news:Xns93AF4F8C3396sdn.comcast@206.127.4.25>:
%% -----BEGIN xxx SIGNED MESSAGE-----
%% Hash: SHA1
%%
%% "Kasp" <kasp@epatra.com> wrote in
%% news:be3qka$l1u$1@newsreader.mailgate.org:
%%
%% > my $x = (5,6,7);
%% > print "$x\n";
%% > my $arrayRef = [1,2,3,['d','g','z']];
%% > print "$arrayRef->[3][1]\n";
%% > my $arrayRef2 = [1,2,3,('d','g','z')];
%% > print "$arrayRef2->[3]\n";
%% >
%% > The output is :
%% > $ perl ref.pl
%% > Useless use of a constant in void context at ref.pl line 4.
%% > Useless use of a constant in void context at ref.pl line 4.
%% > 7
%% > g
%% > d
%%
%% > Now these are some doubts I have:
%% > 1. (5,6,7) represents an array, while [5,6,7] represents an array
%% > reference. Am I right?
%%
%% Partly. [5,6,7] represents an anonymous array reference; that part is
%% right. (5,6,7) can be several things, depending on where you see it.
%% One of the things it can NOT be is an array.
%%
%% It can be a list: @a = (5, 6, 7);
%% It can be arguments to a function: myfunc(5, 6, 7);
%% It can be an expression with two comma operators: $x = (5, 6, 7);
Actually, I'd say the parens in the above expressions all mean the same:
they are there for precedence, although in the second case, they are
probably not needed (unless myfunc has '$' or the empty string as prototype).
In '@a = (5, 6, 7)', it's the fact there's an array on the LHS of the
assignment that makes the RHS a list, not the parenthesis. If you have
'@a = 5', there's still a list on the RHS. The reason you need parens
is because '=' has a lower precedence than the comma.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
------------------------------
Date: 5 Jul 2003 04:11:57 -0700
From: arawind@yahoo.com (ARAVIND)
Subject: dynamic sorting
Message-Id: <1d21ceeb.0307050311.729cb8f4@posting.google.com>
hello,
say i have a variable
$temp = "ARAVIND 25 BANGALORE";
I want just ARAVIND and BANGALORE
if i do
@splitval = split /\d /,$temp;
then i get
$splitval[0] = 'ARAVIND 25';
$splitval[1] = 'BANGALORE';
i can further split it from $splitval[0] and get only ARAVIND.
but how to make it one shot....spliting.
Regards,
Aravind.
------------------------------
Date: Sat, 05 Jul 2003 09:27:46 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: dynamic sorting
Message-Id: <pan.2003.07.05.07.27.44.867783@kamelfreund.de>
ARAVIND wrote at Sat, 05 Jul 2003 04:11:57 -0700:
> say i have a variable
> $temp = "ARAVIND 25 BANGALORE";
> I want just ARAVIND and BANGALORE
> if i do
> @splitval = split /\d /,$temp;
> then i get
> $splitval[0] = 'ARAVIND 25';
> $splitval[1] = 'BANGALORE';
I doubt it. I get
$splitval[0] eq "ARAVIND 2" and
$splitval[1] eq " BANGALORE"
> i can further split it from $splitval[0] and get only ARAVIND.
> but how to make it one shot....spliting.
Well you could do instead a
split /\s*\d+\s*/, $temp;
# or
split /[\s\d]+/, $temp;
But you also could solve it with a regexp:
my @splitval = $temp =~ /(\w+)/g;
Greetings,
Janek
------------------------------
Date: Sat, 5 Jul 2003 12:38:57 +0000 (UTC)
From: Perusion hostmaster <nanae@perusion.com>
Subject: Re: dynamic sorting
Message-Id: <slrnbgdhol.fan.nanae@ns.valuemedia.com>
On 5 Jul 2003 04:11:57 -0700, ARAVIND <arawind@yahoo.com> wrote:
> hello,
>
> say i have a variable
> $temp = "ARAVIND 25 BANGALORE";
> I want just ARAVIND and BANGALORE
> if i do
> @splitval = split /\d /,$temp;
> then i get
> $splitval[0] = 'ARAVIND 25';
> $splitval[1] = 'BANGALORE';
>
> i can further split it from $splitval[0] and get only ARAVIND.
> but how to make it one shot....spliting.
Easy if it always looks that way:
@splitval = split /\s+\d+\s+/, $temp;
Sounds like you need a better way to describe data, though.
--
Perusion Hostmaster
"Being against torture ought to be sort of a bipartisan thing."
-- Karl Lehenbauer
------------------------------
Date: Sat, 05 Jul 2003 09:46:21 GMT
From: grazz@pobox.com
Subject: Re: file opening
Message-Id: <N7xNa.3065$19.860@nwrdny03.gnilink.net>
j <john62@electronmail.com> wrote:
> is there some way to try to open a file in perl such that it will
> fail if the file exists?
$ perldoc -f sysopen
You'd need the O_CREAT and O_EXCL flags, something like:
sysopen(FH, $path, O_WRONLY|O_CREAT|O_EXCL)
or die "sysopen: $path: $!";
--
Steve
------------------------------
Date: Sat, 5 Jul 2003 13:16:36 +0800
From: "bytewolf" <gamelifes@yahoo.com.cn>
Subject: How can I analyse jpg file with perl?
Message-Id: <be5n1m$1jse$1@mail.cn99.com>
Hi~Perlhackers,
I have a problem,so I need your help.
How can I analyse jpg file with perl?
For example:I have a jpg file called text.jpg,when u open it with IE,it will
show u an img with text"I love perl".I want to get the text what in the
text.jpg with perl,what should I do?
It's kind for u to help me,thanks!
Yours sincerely
Bytewolf
------------------------------
Date: Sat, 5 Jul 2003 01:06:02 -0500
From: "J. Smith" <no-email@aol.com>
Subject: Re: How can I analyse jpg file with perl?
Message-Id: <vgcqm4niir9b1@corp.supernews.com>
Do you mean you want to be able to "carry" the jpeg info inside of a perl
script?
open(JPG "<text.jpg") or die "$!";
binmode(JPG);
while(<JPG>) {
print unpack("H*", $data);
# Or pipe it to another filehandle.
}
close(JPG);
Old timers, help me out here. Am I leading this person down the wrong path??
"bytewolf" <gamelifes@yahoo.com.cn> wrote in message
news:be5n1m$1jse$1@mail.cn99.com...
> Hi~Perlhackers,
> I have a problem,so I need your help.
> How can I analyse jpg file with perl?
> For example:I have a jpg file called text.jpg,when u open it with IE,it
will
> show u an img with text"I love perl".I want to get the text what in the
> text.jpg with perl,what should I do?
> It's kind for u to help me,thanks!
> Yours sincerely
> Bytewolf
>
>
------------------------------
Date: Sat, 5 Jul 2003 15:45:25 +0800
From: "bytewolf" <gamelifes@yahoo.com.cn>
Subject: Re: How can I analyse jpg file with perl?
Message-Id: <be5vot$1rbr$1@mail.cn99.com>
Hi~J.Smith,
Thanks for ur reply~~ ^-^
I have tried ur code follow,it prints some datas in the type of hex,it's not
what I want......
In photoshop,I use the text tool to make a sentence "I love perl" and
save it as a jpg
file called text.jpg.Then I want use perl to catch the sentence "I love
perl" what inside of the text.jpg.
How can I do this with perl?
Thanks for ur reply...
(I'm not a English user,So,plz forgive my grammar mistake of English)
Thanks again~~ ^-^
Yours sincerely
Bytewolf
"J. Smith" <no-email@aol.com> дÈëÓʼþ
news:vgcqm4niir9b1@corp.supernews.com...
> Do you mean you want to be able to "carry" the jpeg info inside of a perl
> script?
> #!/usr/bin/perl
> open(JPG,"<text.jpg") or die "$!";
> binmode(JPG);
>
> while(<JPG>) {
>
> print unpack("H*", $_);
> # Or pipe it to another filehandle.
>
> }
>
> close(JPG);
>
> Old timers, help me out here. Am I leading this person down the wrong
path??
>
> "bytewolf" <gamelifes@yahoo.com.cn> wrote in message
> news:be5n1m$1jse$1@mail.cn99.com...
> > Hi~Perlhackers,
> > I have a problem,so I need your help.
> > How can I analyse jpg file with perl?
> > For example:I have a jpg file called text.jpg,when u open it with IE,it
> will
> > show u an img with text"I love perl".I want to get the text what in the
> > text.jpg with perl,what should I do?
> > It's kind for u to help me,thanks!
> > Yours sincerely
> > Bytewolf
> >
> >
>
>
------------------------------
Date: 5 Jul 2003 04:27:21 -0700
From: arawind@yahoo.com (ARAVIND)
Subject: naming hash using a variable name.
Message-Id: <1d21ceeb.0307050327.3e140fd1@posting.google.com>
I have a variable output from one part of program,
$tmp1 = I.LUV.U;
Now,
I want to create a variable of type hash with a name I.LUV.U
i.e. the name of hash to be same as $tmp1,
how can i achieve this?
Regards,
Aravind.
------------------------------
Date: Sat, 5 Jul 2003 12:35:09 +0000 (UTC)
From: Perusion hostmaster <nanae@perusion.com>
Subject: Re: naming hash using a variable name.
Message-Id: <slrnbgdhhh.fan.nanae@ns.valuemedia.com>
On 5 Jul 2003 04:27:21 -0700, ARAVIND <arawind@yahoo.com> wrote:
> I have a variable output from one part of program,
> $tmp1 = I.LUV.U;
> Now,
> I want to create a variable of type hash with a name I.LUV.U
> i.e. the name of hash to be same as $tmp1,
Easy -- use references.
use strict;
use Data::Dumper;
$Data::Dumper::Terse = 1;
my @rand = qw/foo bar baz/;
my $tmp1 = $rand[int rand(scalar(@rand))];
my %hash;
$hash{$tmp1} = {};
if(! @ARGV) {
@ARGV = (
'test value 1, goes to index 0',
'test value 2, goes to index 1',
'test value 3, goes to index 2',
);
}
for(my $i = 0; $i < @ARGV; $i++) {
$hash{$tmp1}{$ARGV[$i]} = $i;
}
print Dumper(\%hash);
If you insist on the tired Perl 4 way:
use strict;
use Data::Dumper;
$Data::Dumper::Terse = 1;
my @rand = qw/foo bar baz/;
my $tmp1 = $rand[int rand(scalar(@rand))];
if(! @ARGV) {
@ARGV = (
'test value 1, goes to index 0',
'test value 2, goes to index 1',
'test value 3, goes to index 2',
);
}
for(my $i = 0; $i < @ARGV; $i++) {
no strict;
${$tmp1}{$ARGV[$i]} = $i;
}
no strict;
print "$tmp1=";
print Dumper(\%{$tmp1});
--
Perusion Hostmaster
"Being against torture ought to be sort of a bipartisan thing."
-- Karl Lehenbauer
------------------------------
Date: Sat, 05 Jul 2003 04:18:51 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: newbie needs to globally edit his site
Message-Id: <LksNa.226$603.12107@iad-read.news.verio.net>
In article <bdqiek$onr$1@bob.news.rcn.net>,
leegold <leegold @ mailandnews.com> wrote:
>I have 25 web pages w/much text and content. I realize now that
>all the pages need the same correction/edit, a name that was not
>capitalized has to changed to a cap.
This is what I used in a similar situation:
unix% cp -rp www www.backup
unix% perl -pi -e 's/reboot.html/Reboot.html/g' www/*.html
unix% diff -r www.backup www | more
unix% rm -r www.backup
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: 05 Jul 2003 12:16:24 +1000
From: Beable van Polasm <beable+unsenet@beable.com.invalid>
Subject: Re: Open URL from email message
Message-Id: <ee8yrdg1l3.fsf@dingo.beable.com>
"Lev Altshuler" <levalt@rogers.com> writes:
> Internet Explorer can be launched with the following system call:
> system("start $url");
> where $url is a variable where we stored URL read by Net::POP3.
> But the task is to emulate a click on the link from email message. Launching
> the browser is not
> an issue here. I am not certain that launching the browser as I described
> above will emulate
> a click on the link from email message.
You know, top-posting and full-quoting like that will get a lot of
people angry with you. You won't like it when a lot of people get
angry with you. Read this page to find out how to do it so that
everybody will accept your contributions:
http://www.netmeister.org/news/learn2quote2.html
As for "emulating a click", what other actions do you think that
clicking on a link would have than to get a web browser to display
the page linked to?
--
No, YOU'RE A CRACKPOT, which is why you think I'm a crackpot...
because all crackpots like you think everybody else is a moron
not them. -- George Hammond
http://beable.com
------------------------------
Date: Sat, 5 Jul 2003 21:21:45 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: problem with Tk800.023.tar.gz from CPAN
Message-Id: <3f06b604$0$22131@echo-01.iinet.net.au>
"Hugo" <zurraspina@yahoo.com> wrote in message
news:ce5e366c.0307030851.46ca80e3@posting.google.com...
> Sorry, but I'm a newbie on this...
>
> 'perl -V:make' returns:
>
> make='make'; ## Is this correct?
>
> And now? what?
>
I guess we conclude that the 'make' you are running is not the 'make' that
was used to build perl. When you try to build Tk you need to be using the
same type of compiler that was used to build your perl.
Do you know what compiler was used to build your perl ? (If so, tell us
which compiler it was.)
Also tell us what operating system you are running and who built your perl.
Do you have the option of building perl yourself with your own compiler ?
Cheers,
Rob
Perhaps we can then work out where the problem lies.
------------------------------
Date: Sat, 5 Jul 2003 21:26:53 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: Problems with perlcc
Message-Id: <3f06b738$0$22136@echo-01.iinet.net.au>
"Dennis Hueckelheim" <dennis.hueckelheim@issdh.com> wrote in message
news:be462g$12n7n$1@ID-139877.news.dfncis.de...
> Hello everybody,
>
> I want to compile a Perl-Script with perlcc. I tried the simple form:
>
> perlcc myscript.pl
>
> But I got much errors:
>
> pccY3V42.c:18482: initializer element is not constant
> pccY3V42.c:18482: (near initialization for `xrv_list[10].xrv_rv')
>
> If I comment this lines:
>
> ----- snipp -----
> use Unicode::String qw(utf8);
> use Fcntl qw(:DEFAULT :flock);
> ----- snipp -----
>
> all works fine. Can someone tell what my problem is?
I can't really answer any of those questions.
There are generally problems with perlcc. I believe it's no longer
maintained.
The best solution is to use the 'pp' utility that comes with the PAR module
(available from cpan).
If you really *must* use perlcc then you're probably on your own :-)
Cheers,
Rob
------------------------------
Date: 5 Jul 2003 00:48:13 -0500
From: "noViagraHere" <requests@zipperpulls.com>
Subject: reading header? results from another script
Message-Id: <3f0665a2$0$53607$45beb828@newscene.com>
Here's the scenario: I want to call the script 'file1.cgi', passing the
desired parameters, store the parameters in mysql, (it works up to here)
then pass the parameters to another server calling 'file2.cgi' then
file2.cgi would in turn pass back simply the text approved or declined only
then
have file1.cgi read the result of file2.cgi and print the result to the
screen.
here's the code I have for file1.cgi:
#!/usr/bin/perl
use DBI;
use CGI qw(param);
$to = param(to_email);
$from = param(from_email);
$transactionid = param(transaction_id);
$transactiondate = param(transaction_date);
$orderid = param(order_id);
$amount = param(amount);
$securitykey = param(security_key);
$status = param(status);
my ($dbh, $sth);
my $db = "xx";
my $user = "xxx";
my $passwd = "xxxx";
my $tableName = "xxxxx";
$dbh = DBI->connect("DBI:mysql:$db:localhost","$user","$passwd");
my $sth = $dbh->prepare("INSERT INTO $tableName VALUES
('$to','$from','$transactionid','$transactiondate','$orderid','$amount','$se
curitykey','$status')");
$sth->execute;
$sth->finish;
$dbh->disconnect;
my $q = CGI->new;
print $q->redirect(
'http://www.here.com/file2.cgi?transaction_id=$transactionid&transaction_dat
e=$transactiondate&order_id=$orderid&amount=$amount&from_email=$from&to_emai
l=$to&security_key=$securitykey' );
print"Content-type:text/html\n\n";
print qq~
<html><head>
<title>Result.</title>
</head>
<body MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0"
bgcolor="#ffffff" link="#0000CC" vlink="#0066FF" alink="#0066FF"
text="#000000">
<br>
~;
if ($to) {
print "To_email: $to<br>\n";
}else{
print "To_email: NULL<br>\n";
}
if ($from) {
print "From_email: $from<br>\n";
}else{
print "From_email: NULL<br>\n";
}
if ($transactionid) {
print "transaction_id: $transactionid<br>\n";
}else{
print "transaction_id: NULL<br>\n";
}
if ($transactiondate) {
print "transaction_date: $transactiondate<br>\n";
}else{
print "transaction_date: NULL<br>\n";
}
if ($orderid) {
print "order_id: $orderid<br>\n";
}else{
print "order_id: NULL<br>\n";
}
if ($amount) {
print "amount: $amount<br>\n";
}else{
print "amount: NULL<br>\n";
}
if ($securitykey) {
print "security_key: $securitykey<br>\n";
}else{
print "security_key: NULL<br>\n";
}
if ($status) {
print "status: $status<br>\n";
}else{
print "status: NULL<br>\n";
}
then print approved or declined as returned by file2.cgi here??
------------------------------
Date: Sat, 5 Jul 2003 09:02:38 +0200
From: "D.Selby" <david.selby@wanadoo.fr>
Subject: thumbnail displaying main pic in new window
Message-Id: <be5sun$1ag$1@news-reader2.wanadoo.fr>
Hi
I'm not sure if this is the best place to post this query .. but if anybody
has any better suggestions, please let me know.
I wonder if somebody could help me. I am using a .cgi perl script to
display data retrieved from a database. Within the .cgi script I am also
displaying photos which are stored directly on the server. When a user
clicks on the thumbnail, I want to be able to display the big picture in a
new window, but I want to specify the size of the window and display it
without toolbar or menubar.
1. Obviously I can use the <A HREF> HTML command and get a new window
coming up .. but I don't see how to suppress the menubar and toolbar etc
like that.
2. I have used the thumbnail image as an <INPUT=image> within a form and
created a javascript open.window function to display the main image. This
works perfectly, displaying the image in the new window as specified.
However, my original window with my .cgi display showing then dies a death
with an internal server error, and this is because the original script has
changed from being called with the original parameters eg
?reference=1234567&live=Y to ?x=162&y=114, which presumably is something to
do with the co-ordinates of the image.
I hope somebody can help me, because I keep going round in circles with
this.
Thanks a lot,
Dee
------------------------------
Date: Sat, 05 Jul 2003 10:56:21 +0100
From: The Sender <wgu_@_wurquhart.co.uk>
Subject: Re: thumbnail displaying main pic in new window
Message-Id: <UlxNa.414$jK2.162@news-binary.blueyonder.co.uk>
D.Selby wrote:
> Hi
>
> I'm not sure if this is the best place to post this query .. but if
> anybody has any better suggestions, please let me know.
>
> I wonder if somebody could help me. I am using a .cgi perl script to
> display data retrieved from a database. Within the .cgi script I am also
> displaying photos which are stored directly on the server. When a user
> clicks on the thumbnail, I want to be able to display the big picture in a
> new window, but I want to specify the size of the window and display it
> without toolbar or menubar.
>
> 1. Obviously I can use the <A HREF> HTML command and get a new window
> coming up .. but I don't see how to suppress the menubar and toolbar etc
> like that.
>
> 2. I have used the thumbnail image as an <INPUT=image> within a form and
> created a javascript open.window function to display the main image. This
> works perfectly, displaying the image in the new window as specified.
> However, my original window with my .cgi display showing then dies a death
> with an internal server error, and this is because the original script has
> changed from being called with the original parameters eg
> ?reference=1234567&live=Y to ?x=162&y=114, which presumably is something
> to do with the co-ordinates of the image.
>
> I hope somebody can help me, because I keep going round in circles with
> this.
>
> Thanks a lot,
>
> Dee
Hi Dee,
This is straight off the top of my bald bit, but...
Since the images are on the main file system why cant you read the header of
the image to get the H&W. Store this a JavaScript VARs in your page or on
the URL for the Link. Write a generic JS function to open a window that
defaults to open(...,'toolbar=no, status=no') and call it from the
HyperLink.
<script language="JavaScript"><!--
function openWnd(Image, Height, Width) {
wnd =
window.open('viewer.cgi?Img='+Image,'myTop','scrollbars=no,status=no,
toolbar=nowidth=' + Width +',height='+ Height) ;
}
//--></script>
<a href="javascript:openWnd(thumb_big.gif,x,y)"><img src="thumb.gif"
border="0" width="64" height="64"></a>
Of course rather than read the file header each time you may want to include
this info in the DB to save you the overhead of the File I/O. The above may
not be 100% syntactically correct but you get the idea.
--
Regards,
William
------------------------------
Date: Sat, 05 Jul 2003 04:06:35 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: trying to parse XML from an email...
Message-Id: <f9sNa.224$603.12107@iad-read.news.verio.net>
In article <cd8b6435.0307020749.6dc639bd@posting.google.com>,
rtl <rtl@trsolutions.net> wrote:
>I am retrieving an email with XML content. I strip off the email
>headings and save only the XML portion to a file.
You should not blindly strip off all of the email headers, especially
the ones that state how the rest of the message is encoded.
Watch out for quoted-printable, uuencode, and BASE64.
You should use a MIME module to parse the message, locate the
attachment, decode it in a manner consistent with the attachment's
headers, and write the decoded data to a file.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Sat, 05 Jul 2003 04:13:52 GMT
From: inwap@inwap.com (Joe Smith)
Subject: Re: What are 'Perl 5 style templates'?
Message-Id: <4gsNa.225$603.12107@iad-read.news.verio.net>
In article <bdrqav$sj2$1@newsreader.mailgate.org>,
Kasp <kasp@epatra.com> wrote:
>My client wrote to me...
>"All scripts must be written in perl 5. Use Perl 5 style templates for all
>pages and emails associated with the perl scripts"
Your client sent you an incomplete message.
The next line of the message should have been:
"Attached is a ZIP file containing acceptable Perl 5 style templates."
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
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 5182
***************************************