[28620] in Perl-Users-Digest
Perl-Users Digest, Issue: 9984 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 20 00:10:17 2006
Date: Sun, 19 Nov 2006 21:10:09 -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 Sun, 19 Nov 2006 Volume: 10 Number: 9984
Today's topics:
Re: Fetching input character without newline? <anon40629@hotmail.com>
Re: Fetching input character without newline? <robertospara@gmail.com>
Re: Fetching input character without newline? <anon40629@hotmail.com>
Re: Fetching input character without newline? <robertospara@gmail.com>
Re: Fetching input character without newline? <robertospara@gmail.com>
Re: Fetching input character without newline? <tadmc@augustmail.com>
Re: Fetching input character without newline? <DJStunks@gmail.com>
Re: Fetching input character without newline? <anon40629@hotmail.com>
Re: Fetching input character without newline? <robertospara@gmail.com>
Re: Fetching input character without newline? <robertospara@gmail.com>
Re: Fetching input character without newline? <robertospara@gmail.com>
Re: Fetching input character without newline? <anon40629@hotmail.com>
Re: How to compress a big file into many zip files with <m@remove.this.part.rtij.nl>
Re: is there a bash script to perl converter? ToddAndMargo@gbis.com
Re: is there a bash script to perl converter? ToddAndMargo@gbis.com
Perl is worth nothing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <robertospara@gmail.com>
Re: Perl is worth nothing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! <tadmc@augustmail.com>
Re: Perl is worth noting! <wahab@chemie.uni-halle.de>
Re: Perl is worth noting! <benmorrow@tiscali.co.uk>
Re: Returning multiple items from a sub? <joe@inwap.com>
Re: Template <trwww@sbcglobal.net>
Re: Template <tadmc@augustmail.com>
Re: Trying to get past code error in Perl book I'm lear (David Combs)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 19 Nov 2006 15:51:58 -0800
From: "Mark" <anon40629@hotmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163980315.469832@bubbleator.drizzle.com>
<anno4000@radom.zrz.tu-berlin.de> wrote:
>
> perldoc -q 'single character'
Well, I had tried Term::ReadKey without success.
I still get a new line onscreen when I press <return>.
I am on a win32 system, perhaps that has something
to do with it.
I am hoping someone can post some actual code
for this, as it seems like something that _ought_ to be
simple. My original thought was that there would be
a "magical" input record separator to use with STDIN,
but if such a beast exists I haven't found it.
-Mark
------------------------------
Date: 19 Nov 2006 15:57:58 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163980678.889934.8620@j44g2000cwa.googlegroups.com>
First of all read quick reference to regular expressions in perl.
Secound U take '\n' - newline character
with <STDIN> and in /^([1-5])$/ U don't want it. So or :
>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
or change regex/^([1-5])/ or /^([1-5])\n$/.
Crazy people, crazy world:)
Mark napisal(a):
> Good afternoon.
>
> I am attempting to solicit user input using the following:
>
> while ()
> {
> print "Enter your response here (1-5): ";
> $ret = <STDIN>;
> if ($ret =~ /^([1-5])$/)
> {print "\nUser chose $1\n";
> last;
> }
> }
>
> This code reprints the prompt string on the next line each time
> the user responds incorrectly. I would _like_ to handle an incorrect
> response by erasing the user's entry and leaving the prompt in place
> on the current line.
>
> Any suggestions on how to do this?
>
> Thanks
> -Mark
------------------------------
Date: Sun, 19 Nov 2006 17:58:51 -0800
From: "Mark" <anon40629@hotmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163987927.841777@bubbleator.drizzle.com>
"robertospara" <robertospara@gmail.com> wrote:
> First of all read quick reference to regular expressions in perl.
> Secound U take '\n' - newline character
> with <STDIN> and in /^([1-5])$/ U don't want it. So or :
>>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> or change regex/^([1-5])/ or /^([1-5])\n$/.
I already tried that one, and it didn't work. The screen output wraps
as soon as I press <enter> and THEN $ret gets the data from STDIN.
So it's too late to try to undo the carriage return as far as STDOUT is
concerned.
This is why I was hoping for a "magic" input record terminator. . .
one that would cause the assignment from STDIN to complete
without causing the screen output to wrap.
------------------------------
Date: 19 Nov 2006 18:18:44 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163989124.305005.54430@m73g2000cwd.googlegroups.com>
U are crazy with your ideas :)
>>>>I already tried that one, and it didn't work.
What U have tried ?????????????????????????????
#!/usr/bin/perl -w
use strict;
print "Enter your response here (1-5): ";
while(<STDIN>){
if (/^([1-5])$/){
print "\nUser chose $1\n";
last;
};
print "Try again (1-5): ";
}
On 20 Lis, 02:58, "Mark" <anon40...@hotmail.com> wrote:
> "robertospara" <robertosp...@gmail.com> wrote:
> > First of all read quick reference to regular expressions in perl.
> > Secound U take '\n' - newline character
> > with <STDIN> and in /^([1-5])$/ U don't want it. So or :
> >>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> > or change regex/^([1-5])/ or /^([1-5])\n$/.I already tried that one, and it didn't work. The screen output wraps
> as soon as I press <enter> and THEN $ret gets the data from STDIN.
> So it's too late to try to undo the carriage return as far as STDOUT is
> concerned.
>
> This is why I was hoping for a "magic" input record terminator. . .
> one that would cause the assignment from STDIN to complete
> without causing the screen output to wrap.
------------------------------
Date: 19 Nov 2006 18:22:25 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163989345.787834.41930@h48g2000cwc.googlegroups.com>
My compiler is showing that construction >>>>>>>>>while() <<<<<<<<
it's a syntax error. And I agree with it value in the brackets is
undefined, so what can we do
with it. Not proper usage of while loop. That what I
think!!!!!!!!!!!!!!
On 20 Lis, 03:18, "robertospara" <robertosp...@gmail.com> wrote:
> U are crazy with your ideas :)>>>>I already tried that one, and it didn't work.What U have tried ?????????????????????????????
> #!/usr/bin/perl -w
>
> use strict;
>
> print "Enter your response here (1-5): ";
> while(<STDIN>){
>
> if (/^([1-5])$/){
> print "\nUser chose $1\n";
> last;
> };
> print "Try again (1-5): ";
>
> }On 20 Lis, 02:58, "Mark" <anon40...@hotmail.com> wrote:
>
> > "robertospara" <robertosp...@gmail.com> wrote:
> > > First of all read quick reference to regular expressions in perl.
> > > Secound U take '\n' - newline character
> > > with <STDIN> and in /^([1-5])$/ U don't want it. So or :
> > >>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> > > or change regex/^([1-5])/ or /^([1-5])\n$/.I already tried that one, and it didn't work. The screen output wraps
> > as soon as I press <enter> and THEN $ret gets the data from STDIN.
> > So it's too late to try to undo the carriage return as far as STDOUT is
> > concerned.
>
> > This is why I was hoping for a "magic" input record terminator. . .
> > one that would cause the assignment from STDIN to complete
> > without causing the screen output to wrap.
------------------------------
Date: Sun, 19 Nov 2006 19:54:24 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <slrnem22mg.8f8.tadmc@tadmc30.august.net>
robertospara <robertospara@gmail.com> wrote:
> First of all read quick reference to regular expressions in perl.
You should do that too perhaps...
> Secound U take '\n' - newline character
> with <STDIN> and in /^([1-5])$/ U don't want it.
Why not?
It works just fine with or without the newline.
> So or :
>>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> or change regex/^([1-5])/ or /^([1-5])\n$/.
Nonsense.
> Crazy people, crazy world:)
And crazy followups (but we would expect that when they are top-posted...)
[ snip TOFU ]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Nov 2006 18:23:20 -0800
From: "DJ Stunks" <DJStunks@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163989400.347308.291710@h54g2000cwb.googlegroups.com>
Mark wrote:
> <anno4000@radom.zrz.tu-berlin.de> wrote:
> >
> > perldoc -q 'single character'
>
> Well, I had tried Term::ReadKey without success.
> I still get a new line onscreen when I press <return>.
I think you should try using Term::ReadKey a little harder...
> I am on a win32 system, perhaps that has something
> to do with it.
that has nothing to do with it.
-jp
------------------------------
Date: Sun, 19 Nov 2006 18:29:33 -0800
From: "Mark" <anon40629@hotmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163989769.627347@bubbleator.drizzle.com>
"robertospara" <robertospara@gmail.com> wrote:
>
> U are crazy with your ideas :)
>>>>>I already tried that one, and it didn't work.
> What U have tried ?????????????????????????????
> #!/usr/bin/perl -w
>
> use strict;
>
> print "Enter your response here (1-5): ";
> while(<STDIN>){
>
> if (/^([1-5])$/){
> print "\nUser chose $1\n";
> last;
> };
> print "Try again (1-5): ";
Close, but not quite. The terminal output still
wraps when the prompt is reprinted after an
incorrect entry.
I tried this code on Win32 and on Linux and
the behavior is the same on both.
It may not be possible (or at least not worthwhile)
to get what I'm looking for here.
------------------------------
Date: 19 Nov 2006 18:39:18 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163990358.113845.86630@h48g2000cwc.googlegroups.com>
Look up my Dire.
I was first.
You didn't help him, so what is nonsense:
1) Stare at the people;
2) Or live with them and help them.
I prefer second.
But my fault.
/^([1-5])$/ is almost perfect.
I forgot that new line is after $ in NFA Tad McClellan.
Starring at the people is some of fetish in it. Isn't
it???????????????????????????
On 20 Lis, 02:54, Tad McClellan <t...@augustmail.com> wrote:
> robertospara <robertosp...@gmail.com> wrote:
> > First of all read quick reference to regular expressions in perl.You should do that too perhaps...
>
> > Secound U take '\n' - newline character
> > with <STDIN> and in /^([1-5])$/ U don't want it.Why not?
>
> It works just fine with or without the newline.
>
> > So or :
> >>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> > or change regex/^([1-5])/ or /^([1-5])\n$/.Nonsense.
>
> > Crazy people, crazy world:)And crazy followups (but we would expect that when they are top-posted...)
>
> [ snip TOFU ]
>
> --
> Tad McClellan SGML consulting
> t...@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: 19 Nov 2006 18:44:22 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163990662.508895.99100@h48g2000cwc.googlegroups.com>
Did U compile your code Mark ????
I can not????
So ????????
On 20 Lis, 03:39, "robertospara" <robertosp...@gmail.com> wrote:
> Look up my Dire.
> I was first.
> You didn't help him, so what is nonsense:
>
> 1) Stare at the people;
> 2) Or live with them and help them.
> I prefer second.
> But my fault.
> /^([1-5])$/ is almost perfect.
> I forgot that new line is after $ in NFA Tad McClellan.
> Starring at the people is some of fetish in it. Isn't
> it???????????????????????????
>
> On 20 Lis, 02:54, Tad McClellan <t...@augustmail.com> wrote:
>
> > robertospara <robertosp...@gmail.com> wrote:
> > > First of all read quick reference to regular expressions in perl.You should do that too perhaps...
>
> > > Secound U take '\n' - newline character
> > > with <STDIN> and in /^([1-5])$/ U don't want it.Why not?
>
> > It works just fine with or without the newline.
>
> > > So or :
> > >>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> > > or change regex/^([1-5])/ or /^([1-5])\n$/.Nonsense.
>
> > > Crazy people, crazy world:)And crazy followups (but we would expect that when they are top-posted...)
>
> > [ snip TOFU ]
>
> > --
> > Tad McClellan SGML consulting
> > t...@augustmail.com Perl programming
> > Fort Worth, Texas
------------------------------
Date: 19 Nov 2006 18:51:04 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163991064.195784.243160@k70g2000cwa.googlegroups.com>
Question to Tad McLellan:
Is there something in Perl like '\0' in C????????
U seams to be smart????????
So??????????????????????????????
On 20 Lis, 03:44, "robertospara" <robertosp...@gmail.com> wrote:
> Did U compile your code Mark ????
> I can not????
> So ????????
> On 20 Lis, 03:39, "robertospara" <robertosp...@gmail.com> wrote:
>
> > Look up my Dire.
> > I was first.
> > You didn't help him, so what is nonsense:
>
> > 1) Stare at the people;
> > 2) Or live with them and help them.
> > I prefer second.
> > But my fault.
> > /^([1-5])$/ is almost perfect.
> > I forgot that new line is after $ in NFA Tad McClellan.
> > Starring at the people is some of fetish in it. Isn't
> > it???????????????????????????
>
> > On 20 Lis, 02:54, Tad McClellan <t...@augustmail.com> wrote:
>
> > > robertospara <robertosp...@gmail.com> wrote:
> > > > First of all read quick reference to regular expressions in perl.You should do that too perhaps...
>
> > > > Secound U take '\n' - newline character
> > > > with <STDIN> and in /^([1-5])$/ U don't want it.Why not?
>
> > > It works just fine with or without the newline.
>
> > > > So or :
> > > >>>>>>>>>>>>>>>>>chomp $ret;<<<<<<<<<<<<<<<<<<<<
> > > > or change regex/^([1-5])/ or /^([1-5])\n$/.Nonsense.
>
> > > > Crazy people, crazy world:)And crazy followups (but we would expect that when they are top-posted...)
>
> > > [ snip TOFU ]
>
> > > --
> > > Tad McClellan SGML consulting
> > > t...@augustmail.com Perl programming
> > > Fort Worth, Texas
------------------------------
Date: Sun, 19 Nov 2006 20:33:31 -0800
From: "Mark" <anon40629@hotmail.com>
Subject: Re: Fetching input character without newline?
Message-Id: <1163997207.245697@bubbleator.drizzle.com>
"DJ Stunks" <DJStunks@gmail.com> wrote:
>
> I think you should try using Term::ReadKey a little harder...
(pours a gin & tonic...)
Ok, this is as close as I can get to what I was trying to describe:
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
use Term::ReadKey;
ReadMode 3;
$key = "";
print "Your input? [(Y)es|(N)o|(Q)uit]: ";
while ($key !~ /^[y|n|q]$/i)
{
$key = ReadKey 0;
}
printf "\nYou entered $key\n";
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Actually this is probably what I _should_ have been trying
to come up with. Incorrect responses are not echoed on
screen; a correct response is processed.
What I was _trying_ to get was the behavior that this script
provides, with incorrect respones being echoed onscreen,
with the list of incorrect respones growing towards the right
until a correct resonse is eventually given. But this is probably
a more sensible implementation.
But if anyone knows how to implement this script with the
incorrect responses echoed on screen, I would like to see it.
Thanks
-Mark
------------------------------
Date: Mon, 20 Nov 2006 00:27:27 +0100
From: Martijn Lievaart <m@remove.this.part.rtij.nl>
Subject: Re: How to compress a big file into many zip files with Archive::Zip?
Message-Id: <pan.2006.11.19.23.27.27.358890@remove.this.part.rtij.nl>
On Sun, 19 Nov 2006 21:48:32 +0000, anno4000 wrote:
> Martijn Lievaart <m@remove.this.part.rtij.nl> wrote in comp.lang.perl.misc:
>> On Sun, 19 Nov 2006 10:05:41 +0000, anno4000 wrote:
>>
>> >> And I have read the Archive::Zip document, and didn't
>> >> find any stuff about that.
>> >
>> > That's because Archive::Zip is about compressing files, not
>> > splitting them.
>>
>> However, zip has options for multivolume archives, Archive::Zip just
>> doesn't support it. So the expectation is not unreasonable.
>
> Multivolume archives are meant to handle the case when a an archive
> doesn't fit on a single volume (of tape, usually). It may be possible
> to press the mechanism into service for splitting a single file into
> smaller chunks, but that isn't what it's there for.
I know several other use cases where splitting makes sense.
> Unix (and presumably Cygwin) has the split command to do this.
> Splitting is still not the right way to transfer a file that is
> too big for mail.
Amen.
However, I worked in several environments where you had to make do with
what whas there. SMTP is not suited to transfer large files and as I
stated somewhere else in this thread, other mechanisms are better, easier
and may be triggered on an email. But if all you have is a hammer....
M4
--
Redundancy is a great way to introduce more single points of failure.
------------------------------
Date: 19 Nov 2006 18:28:20 -0800
From: ToddAndMargo@gbis.com
Subject: Re: is there a bash script to perl converter?
Message-Id: <1163989700.396221.84630@j44g2000cwa.googlegroups.com>
Tintin wrote:
> <ToddAndMargo@gbis.com> wrote in message
> news:1163825339.671311.207020@m73g2000cwd.googlegroups.com...
> > Hi All,
> >
> > Is there a such thing as a bash script to perl converter?
>
> Yes. It's called a programmer.
:-)
------------------------------
Date: 19 Nov 2006 18:30:48 -0800
From: ToddAndMargo@gbis.com
Subject: Re: is there a bash script to perl converter?
Message-Id: <1163989848.119493.86590@m73g2000cwd.googlegroups.com>
Tad McClellan wrote:
> ><ToddAndMargo@gbis.com> wrote in message
> > news:1163825339.671311.207020@m73g2000cwd.googlegroups.com...
> >> Hi All,
> >>
> >> Is there a such thing as a bash script to perl converter?
> ...because shell scripts don't really do much themselves, most of their
> "heavy lifting" is done by calling other programs.
>
> So to make a shell script converter, you would need all of those
> other programs in Perl as well.
Rats. But, it makes complete sense. You'd have to have sed, awk,
grep, sort, and all those other assorted goodies.
Many thanks,
-T
------------------------------
Date: 19 Nov 2006 16:16:14 -0800
From: "robertospara" <robertospara@gmail.com>
Subject: Perl is worth nothing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <1163981774.441857.19990@m7g2000cwm.googlegroups.com>
It's language with only theoretical objective support.
It's to slow.
It's to much memory required.
It's not for every platform.
There's no types so programmer can make much more mistakes.
It's not readable to find out what other programmer wanted to have
when U read largest projects,
specially when this first was not using >>> -w <<<< or >>> use strict
<<<.
Perl society of masters is closed and unfriendly to the others.
------------------------------
Date: Sun, 19 Nov 2006 20:21:11 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl is worth nothing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Message-Id: <slrnem248n.8f8.tadmc@tadmc30.august.net>
robertospara <robertospara@gmail.com> wrote:
> It's language with only theoretical objective support.
> It's to slow.
> It's to much memory required.
> It's not for every platform.
> There's no types so programmer can make much more mistakes.
> It's not readable to find out what other programmer wanted to have
> when U read largest projects,
> specially when this first was not using >>> -w <<<< or >>> use strict
><<<.
> Perl society of masters is closed and unfriendly to the others.
And what is your point?
If you don't like Perl, then don't use Perl.
There are plenty of other fine languages out there.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 20 Nov 2006 01:37:46 +0100
From: Mirco Wahab <wahab@chemie.uni-halle.de>
Subject: Re: Perl is worth noting!
Message-Id: <ejqtmf$tt$1@mlucom4.urz.uni-halle.de>
Thus spoke robertospara (on 2006-11-20 01:16):
> It's language with only theoretical objective support.
This is a remark which I didn't really understand.
> It's to slow.
Right, like my old Ford Escort/90HP.
> It's to much memory required.
Right, like every day remembering all dates
and little things to get and do for the family.
> It's not for every platform.
Right, somebody dropped me an old 386-Win 3.0 Laptop
and I can't get it (P.) installed.
> There's no types so programmer can make much more mistakes.
Right and wrong. At least *5* types (kind of) there are ...
(CODE, SCALAR, ARRAY, HASH, FORMAT - did I miss one?)
> It's not readable to find out what other programmer wanted
> to have when U read largest projects, specially when this
> first was not using >>> -w <<<< or >>> use strict <<<.
Right. This is clearly a problem "with the programmer",
who took a programming language for whatever reason and
failed to apply it properly. This is like
"This Barbarian Sword sucks, I tried it and trimmed my foot of".
> Perl society of masters is closed and unfriendly to the others.
Right, so try to become a part of it - then you can drool
on the other people too ...
Regards
Mirco
------------------------------
Date: Mon, 20 Nov 2006 02:16:32 +0000
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Perl is worth noting!
Message-Id: <0pf734-qnc.ln1@osiris.mauzo.dyndns.org>
Quoth wahab-mail@gmx.net:
> Thus spoke robertospara (on 2006-11-20 01:16):
...and we seem to have a new troll...
> > There's no types so programmer can make much more mistakes.
>
> Right and wrong. At least *5* types (kind of) there are ...
> (CODE, SCALAR, ARRAY, HASH, FORMAT - did I miss one?)
Several. GLOB and IO at least; also, the various kinds of scalar (undef,
IV, NV, PV, RV, and the evil hacks that are Regexp and PVs-with-the-
UTF8-flag) can be regarded as dynamic types.
sv.h lists 16 types of perl value; the others (PVIV and PVNV for scalars
that have both a numeric and a string value; PVMG for blessed scalars;
PVBM for making index and regexen run faster; and PVLV for lvalue
substr) are not visible from Perl.
Ben
--
Razors pain you / Rivers are damp
Acids stain you / And drugs cause cramp. [Dorothy Parker]
Guns aren't lawful / Nooses give
Gas smells awful / You might as well live. benmorrow@tiscali.co.uk
------------------------------
Date: Sun, 19 Nov 2006 21:01:49 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Returning multiple items from a sub?
Message-Id: <JfKdnbchva9kq_zYnZ2dnUVZ_hydnZ2d@comcast.com>
robb@acm.org wrote:
> Is it possible to write a sub that can be used in this way? I haven't
> figured it out.
If you want a function/method to return several things, then
you simple return several things. Period.
sub return_three_things {
...
return ($first,$second,$third};
}
What's so hard about that?
------------------------------
Date: Mon, 20 Nov 2006 02:11:16 GMT
From: "Todd W" <trwww@sbcglobal.net>
Subject: Re: Template
Message-Id: <8988h.8443$6t.1162@newssvr11.news.prodigy.com>
"Lee" <lskatz@gmail.com> wrote in message
news:1163968845.667301.101690@m73g2000cwd.googlegroups.com...
> Hi,
> I have this template file that I am opening in my script.
>
> <tr>
<snip />
> </tr>
> If there are any perl, php, or javascript libraries out there for this
> sort of thing, I'd like to know about it!
Sure is. Jemplate. It is a javascript implementation of Template::Toolkit.
Works great.
http://search.cpan.org/dist/Jemplate/
Todd W.
------------------------------
Date: Sun, 19 Nov 2006 20:08:04 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Template
Message-Id: <slrnem23g4.8f8.tadmc@tadmc30.august.net>
Lee <lskatz@gmail.com> wrote:
><tr>
> <td>{var1}</td>
> <td>{var2}</td>
>
> <td>
> <table>
> <tr>
> <td>Name: {name3}</td>
> <td>Age: {age3}</td>
> </tr>
> </table>
> </td>
>
></tr>
>
> Are there any good regular expressions to grab each tag and its
> contents?
No. But here is a bad one that grabs the contents of all tags
in _your_ data (it can be easily broken by other legal HTML data though):
foreach my $tag ( /(<[^>]+>)/g ) {
print "$tag\n";
}
But I expect you don't really want what you've asked for, you
probably want the contents of *element* rather than tags. For
that you should...
> If there are any perl, php, or javascript libraries out there for this
> sort of thing, I'd like to know about it!
... use a module that understands HTML data when you need to
process HTML data:
http://search.cpan.org/search?query=HTML+parser&mode=all
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 20 Nov 2006 02:06:27 +0000 (UTC)
From: dkcombs@panix.com (David Combs)
Subject: Re: Trying to get past code error in Perl book I'm learning from
Message-Id: <ejr2j3$rvn$1@reader2.panix.com>
In article <Xns9864812FBDFC9castleamber@130.133.1.4>,
John Bokma <john@castleamber.com> wrote:
>"rankenory@gmail.com" <rankenory@gmail.com> wrote:
>
>> I'm learning Perl from a book called "Learn Perl in a Weekend."
>
>I am sorry for you. Throw that piece of junk out of the window and get a
>good book. Books like learn xxx in yyy are a waste of more then yyy time
>sadly.
>
>--
>John Experienced Perl programmer: http://castleamber.com/
>
> Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
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 9984
***************************************