[17266] in Perl-Users-Digest
Perl-Users Digest, Issue: 4688 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 22 06:05:39 2000
Date: Sun, 22 Oct 2000 03:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <972209108-v9-i4688@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 22 Oct 2000 Volume: 9 Number: 4688
Today's topics:
Re: Array stuck within a loop <bhui_ipsg@yahoo.com>
Re: Boolean query to Perl regexp match conversion (Tom Christiansen)
Re: Boolean query to Perl regexp match conversion (Ilya Zakharevich)
Re: Help with array concatenation <Jodyman@usa.net>
Re: Help with array concatenation <uri@sysarch.com>
Re: Help with array concatenation <Jodyman@usa.net>
Re: Help with array concatenation (Eric Bohlman)
help with system () <rsmallwood@mindspring.com>
Re: help with system () <rsmallwood@mindspring.com>
Re: here and filehandle <jeffp@crusoe.net>
I need a source to paste data on another website programmer4k@my-deja.com
posting variables.... simple question <miriamsmit@zonnet.nl>
Re: Probably a very simple question, but I'm confused.. <mjamesj@pacbell.nopr0nads.net>
Re: Regex for matching e-mail addresses (Scott Roberts)
Re: Rijndael in Perl (Vernon Schryver)
Re: Rijndael in Perl <dido@pacific.net.ph>
Simple file/open/print help please (jxavier)
Re: Simple file/open/print help please <uri@sysarch.com>
Re: still need help/beginner....pulling my hair ! <none@nospam.com>
Re: still need help/beginner....pulling my hair ! <uri@sysarch.com>
Re: use linux cmd 'passwd' with perl <danny@lennon.postino.com>
Re: use linux cmd 'passwd' with perl <bowman@montana.com>
Re: Using text file to display form data (Eric Bohlman)
Re: XML::XSLT ?? <thinc@punch.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 22 Oct 2000 01:27:11 GMT
From: "bhui" <bhui_ipsg@yahoo.com>
Subject: Re: Array stuck within a loop
Message-Id: <PnrI5.500084$8u4.6211389@news1.rdc1.bc.home.com>
Thx everyone for your replies the index and suggestions have been very
helpful. this has been my first post on a board and I will leave the right
data next time around.
Ben
------------------------------
Date: 21 Oct 2000 19:41:15 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Boolean query to Perl regexp match conversion
Message-Id: <39f245bb$1@cs.colorado.edu>
In article <211020001728347441%lincmad001@telecom-digest.zzn.com>,
>You're much less likely to get non-Perl-programmers to write that sort
>of search query in Perl syntax.
Think of it as evolution in action: survival of the clueful.
--tom
------------------------------
Date: 22 Oct 2000 01:58:12 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Boolean query to Perl regexp match conversion
Message-Id: <8sthjk$1ka$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Gwyn Judd
<tjla@guvfybir.qlaqaf.bet>],
who wrote in article <slrn8v4f5v.n56.tjla@thislove.dyndns.org>:
> But /blah*/ matches the same strings as /blah.*/ which matches the same
> strings as /blah/. Therefore they have the same meaning.
^^^^^^
Make this /bla/ with suitable corrections in other places.
Ilya
------------------------------
Date: Sun, 22 Oct 2000 01:50:39 -0400
From: "Jody Fedor" <Jodyman@usa.net>
Subject: Re: Help with array concatenation
Message-Id: <8stvei$3q7$1@plonk.apk.net>
Ren Maddox wrote in message ...
>"Jody Fedor" <Jodyman@usa.net> writes:
>
>[snip]
>> Any help would be appreciated.
>
>Uri already gave you some great information that should get you going,
>but I thought I would point out the specific problem you are hitting...
>
>> @dates = unpack(A3 x ((length($cline)/3)+1), $cline);
>
>This lines replaces the value of @dates every time it executes. You
>probably want something like:
>
>push @dates, unpack...
Thanks Ren, this is exactly what I want. Once again, another function
(push) I'll need to read up on. I know what push & pop do in machine
language but have never used them in perl... so... here's to learning
something new, each and every day.
Jody
------------------------------
Date: Sun, 22 Oct 2000 06:15:31 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Help with array concatenation
Message-Id: <x71yx9pfjv.fsf@home.sysarch.com>
>>>>> "JF" == Jody Fedor <Jodyman@usa.net> writes:
JF> Thanks Ren, this is exactly what I want. Once again, another
JF> function (push) I'll need to read up on. I know what push & pop
JF> do in machine language but have never used them in perl... so...
JF> here's to learning something new, each and every day.
you seem to keep learning a function a day. why not sit down and read
all of perlfunc. even if you don't learn them all you will see many that
are useful. push and pop are only a couple of the dozens you need to
have in your vocabulary. so it is best to see all of them once and then
learn the more common ones in depth. then go on to other perldocs. you
can learn the entire language on line for free by just reading them in a
decent sequence and cross referencing between them. along the way read
the entire FAQ. at least once completely. reread docs whenever you feel
the need. there is no shame in doing that. no one knows the docs 100%. a
handful know it very close to that. :)
this is how you learn perl.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 22 Oct 2000 02:30:21 -0400
From: "Jody Fedor" <Jodyman@usa.net>
Subject: Re: Help with array concatenation
Message-Id: <8su1ov$4v8$1@plonk.apk.net>
Uri Guttman wrote in message ...
>this is how you learn perl.
I'm a learn by example type of programmer. I think I can learn
more from the Perl Cookbook or programming to solve a problem
better than reading a book from cover to cover. BUT, yes, I have
read ALL the Camel book, All the Ram book, All the Llama book,
Panther, Owl and currently reading the Cheetah book. I just ordered
the Mouse too! I'm keeping O'Reilly in business as well as alot
of the GURU posters in this newsgroup. Excellent books all but
hard to understand until you run into a problem that requires their
expertise and then you read them in a new light.
Remember the first time you understood what $_ was? How
about #!/usr/bin/perl -w and use strict ? I've only been perl
programming for about a year now but I can remember asking
the dumb questions. I wish I knew alot more so I could help
those who really are trying to learn perl by playing with the code
until they get it right. I'll get there someday.
Jody
PS - I love the explained, step by step, examples given a lot of
times, I learn more from them than a lecture or ref book.
PSS - Anyone heard of a Perl By Example book?
------------------------------
Date: 22 Oct 2000 06:56:49 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Help with array concatenation
Message-Id: <8su33h$2v4o$3@news.enteract.com>
Jody Fedor <Jodyman@usa.net> wrote:
> Uri Guttman wrote in message ...
>> JF> $yr = "2000"; # Hard code for testing
>> JF> @days = (31,28,31,30,31,30,31,31,30,31,30,31);
>> JF> if ($yr%4 == 0) {$days[1] = 29} else {$days[1] = 28};
>>
>>DUH!! that code is seriously broken. it will fail in 2100, 2200,
>>etc. you are lucky that 2000 is divisible by 400 or it would have failed
>>this year.
> This I know, once again, I'll be dead in 2100 so I won't have to worry
> about it!
IMHO, that's not really a good excuse. A few years from now (say 4
years), someone might read your code, realize they need to do a leap-year
check, and copy it for their own program. And 4 years from then, someone
else might do the same thing with your copied code. And on and on, until
someone writes some code that really does have to deal with dates in 2100
(which could happen well before 2100). Faulty code propagates
memetically, and it can be very hard to stop the propagation after a
surprisingly short time. Don't write urban legends into your code.
------------------------------
Date: Sun, 22 Oct 2000 05:28:25 GMT
From: Russell Smallwood <rsmallwood@mindspring.com>
Subject: help with system ()
Message-Id: <MPG.145c47308969e261989683@news.giganews.com>
All,
Perhaps I've not taken my medication today, but I'm having trouble
passing a variable to an .exe file like this:
system("d:\\my folder\\myprogram.exe $myvar");
If I use a literal
system("d:\\my folder\\myprogram.exe 555");
everything works, but with the var, the script just hangs.
Have I missed something in the perldocs? Why can't you search the
perldocs? whah.
Russell
------------------------------
Date: Sun, 22 Oct 2000 06:10:09 GMT
From: Russell Smallwood <rsmallwood@mindspring.com>
Subject: Re: help with system ()
Message-Id: <MPG.145c518149fa704989684@news.giganews.com>
In article <MPG.145c47308969e261989683@news.giganews.com>,
rsmallwood@mindspring.com says...
> All,
>
> Perhaps I've not taken my medication today, but I'm having trouble
> passing a variable to an .exe file like this:
>
> system("d:\\my folder\\myprogram.exe $myvar");
>
> If I use a literal
>
> system("d:\\my folder\\myprogram.exe 555");
>
> everything works, but with the var, the script just hangs.
>
> Have I missed something in the perldocs? Why can't you search the
> perldocs? whah.
>
> Russell
>
I've also tried:
@args=("d:\\my folder\\myprogram.exe",$myvar);
system(@args)
but to the same effect, the script hangs and the process doesn't
terminate on the server.
------------------------------
Date: Sat, 21 Oct 2000 21:57:22 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: here and filehandle
Message-Id: <Pine.GSO.4.21.0010212149280.25707-100000@crusoe.crusoe.net>
[posted & mailed]
On Oct 21, Ryan Travis Tate said:
> |> print SMB_CONF <<EOF;
>
>print SMB CONF <<"EOF";
Actually, here-docs are quite poorly documented. The rules on quoting
your here-doc identifier are as follows:
* the identifier needn't be quoted if it is a sequence of
alphanumberscore characters (/[a-zA-Z0-9_]+/) and DIRECTLY follows the
'<<' (that is, NO whitespace between '<<' and identifier)
* the identifier must be quoted if there is whitespace between the '<<'
and the identifier, or if it is NOT a sequence of alphanumberscore
characters
Also, note that the identifier does not undergo the same quoting
interpolation as regular text (this, too, is not documented):
# can't find terminator "$foo"
$foo = 'END';
print << "$foo";
this
END
# it expects a newline as the terminator
$foo = 'END';
print << $foo;
this
$foo
# this works
$foo = 'END';
print << '$foo';
this
$foo
# so does this
$foo = 'END';
print << "$foo";
this
$foo
# you have to backslash backslashes, but they MUST appear at the end
print << "FOO\\";
this
FOO\\
# can't find terminator "FOO\\"
print << "FOO\\";
this
FOO\
There are a few other nuances, like the empty string terminator:
print <<;
waits for blank line
like right here
print "Right above me was a blank line\n";
Again, here-docs aren't documented well. It's a shame.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Sun, 22 Oct 2000 00:56:51 GMT
From: programmer4k@my-deja.com
Subject: I need a source to paste data on another website
Message-Id: <8ste0h$1a0$1@nnrp1.deja.com>
Hello. I need a source to make a form that takes the data gathered from
the form and pastes it into a table on another website. For exampple:
User types in following in a form:
Name: Fred
Number: 31
This data is then submited into a table on the same server just a
different site...
Name Number
Fred 31
If anyone can help, please e-mail me back at
programmer4k@hotmail.com..I will give complete credit on my website and
generosity will be great.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 22 Oct 2000 11:26:13 +0200
From: "Michel Wouterse" <miriamsmit@zonnet.nl>
Subject: posting variables.... simple question
Message-Id: <4lyI5.24321$tL4.287987@zonnet-reader-1>
Hi,
Is there a way to post values from a perl cgi into another perl cgi?
The second perl cgi should "think" that the values where posted from a form
on a website, using the POST method.
I can only use the GET method, but I do not want this.
Is there a way??
Thanks!!
Michel
PS: or is there a way to make a form with different actions
(login.cgi-signup.cgi-delete.cgi) depending on which submitbutton you click?
------------------------------
Date: Sat, 21 Oct 2000 18:48:59 -0700
From: mike <mjamesj@pacbell.nopr0nads.net>
Subject: Re: Probably a very simple question, but I'm confused..Perl on NT
Message-Id: <sih4vsg2kntbrjqrcat9fiolcfv45q3sd8@4ax.com>
On Thu, 19 Oct 2000 17:21:25 +0200, Alexander Nietzschmann
<dj.peppone@gmx.net> wrote:
>Hi Mike,
>
>> $login = &NTLoginName;
>
>in this case, the perl interpreter expects a function called
>"NTLoginName" in YOUR script, if You don't tell perl "use Win32"
>first.
>
>> but when I try that I get undefined subroutine in &main::NTLoginName.
>
>This is the result.
>
>> If I try $login = Win32::LoginName() it works, whether or not I
>
>With this line, You tell perl to use the function "LoginName()" which
>is contained in package "Win32".
>
>Have You ever tried
>
>use Win32;
>[ blahblah ... ]
>$LOGIN = LoginName;
>
>> this point. Is it maybe a problem with the difference between
>> ActiveState's version and the Perl5 for Win32 that the book is based
>> on as far as why the &LoginName syntax doesn't work?
>
>No.
>
>> How can I determine what functions are built-in? I still haven't been
>> able to find either a list or how to find them. I even downloaded the
>> source code, but I'm even more lost there.
>
>Try typing "perldoc perlfunc" at the command prompt. Further, there's
>an excellent HTML-Documentation in ActiveState's Perl.
>
>Greets, Alex
Thanks Alex. The line was from a script in the Teach Yourself Perl 5
for Windows NT book. (pg 541, listing 15.1, in case anyone has the
book) Apparently the script is just plain wrong. Nothing about use
Win32. According to the text these functions are built in. I guess
not. I haven't checked the book's website to see if there is an
errata. That probably should've been my first stop.
mike
______________________________________________________________________
Posted Via Uncensored-News.Com - Still Only $9.95 - http://www.uncensored-news.com
With Servers In California, Texas And Virginia - The Worlds Uncensored News Source
------------------------------
Date: Sun, 22 Oct 2000 01:20:28 GMT
From: scott@heelspurs.castrate.this.part.com (Scott Roberts)
Subject: Re: Regex for matching e-mail addresses
Message-Id: <39f23ffe.20964911@news.knology.net>
>Hi!
>
>I'm looking for a regex for matching regular expressions.
>
>For example, given the string:
>$a= "\"Gont \@ Fernando Ariel", <fernando\@hey.com>,
>someone\@somewhere.com";
>
>It should only match "fernando\@hey.com" and "someone@@somewhere.com"
>
>Kind regards,
>
>Fernando Gont
>e-mail: fgont@ANTISPAM.softhome.net
Thanks for the reg exp. All the brilliant jerks don't seem to want to
sully themselves enough to place an approximation like that in any of
the books I've got. I checked it on 1431 email address that do not
bounce back (valid as well as well-formed) as they were typed into a
web form for addition to an email list, and your reg exp didn't block
any of them. That means a 50% chance of it working correctly 99.93% of
the time (not yet enough to prove your claimed 0.01% accuracy) for my
purposes (simple form for people to sign up), except I would first
delete any trailing spaces so yours is more likely to match. People
often seem to throw in extra spaces at random in the middle of an
email addess, so I delete those.
So if he's immoral as another poster claim for blocking 1% or more of
the email addresses, and since he's apparently blocking only 0.07% or
fewer, does that mean he's only 7% immoral?
------------------------------
Date: 21 Oct 2000 10:45:04 -0600
From: vjs@calcite.rhyolite.com (Vernon Schryver)
Subject: Re: Rijndael in Perl
Message-Id: <8ssh6g$7hl$1@calcite.rhyolite.com>
In article <8srmlj$a1g3$1@fido.engr.sgi.com>,
Rob Warnock <rpw3@rigden.engr.sgi.com> wrote:
>Runu Knips <runu.knips@gmx.de> wrote:
>+---------------
>| > attacker looks at what's "left behind" (tempfiles, diskswapping...).
>|
>| Is it actually possible with Windows or Linux to get memory which isn't
>| swappable ? As an ordinary user process, or as a administrator process ?
>+---------------
>
>Most Unixes -- e.g., Linux, FreeBSD, SGI's Irix, many others -- have
>"mlock(2)" or "mpin(2)" or "plock(2) ...
Yes, but do those functions guarantee that memory will never be
written to some kind of backing store? It's one thing to tell the
operating gystem that some memory must remain in fast memory but
something else to ask that some bits never be leaked to anything
that might be considered semi-stable storage.
>Dunno 'bout Windows, though...
I don't see any relevant knobs in my set of WIN32 documentation, although
there are controls on various aspects of memory.
You can tell Windows 95/98 to not do any swapping, and perhaps that
would be enough. You can do similar or equivalent things on many UNIX
system. For example, your program might open the raw partition which
you've assigned for swapping and scribble on it.
It seems to me that if you really care, you must do the sorts of things
that professionals do, including treating any stable storage that has been
in the same system with your secrets as potentially containing your
secrets. You must also take generous view of the notion of "system,"
including considering the parts that are connected only by network stuff.
Anyone who has been to even a moderately secret government installation
knows that while you can often take in disks and such, you can't get them
out in a useful form.
Vernon Schryver vjs@rhyolite.com
------------------------------
Date: Sun, 22 Oct 2000 17:33:22 +0800
From: Dido Sevilla <dido@pacific.net.ph>
Subject: Re: Rijndael in Perl
Message-Id: <39F2B462.96FF4A7E@pacific.net.ph>
Sam Trenholme wrote:
>
> >http://home.pacific.net.ph/~dido/Crypt-Rijndael-0.01.tar.gz
>
> I noticed that a script called makertbls.pl is referred to in the code,
> but is not part of this archive.
>
> I would like to look at this script, so I can get a better picture of
> Rijndael in my mind. I am slowly but surely "getting" how it works.
>
Unfortunately, I no longer have this script on my hard disk. I have
sent you a similar script by private email which generates the tables
for encryption only. I'll leave the table generation for the decryption
tables to you. Read section 5.2.1 of the Rijndael spec.
--
Rafael R. Sevilla <dido@pacific.net.ph> +63 (2) 4342217
ICSM-F Development Team, UP Diliman +63 (917) 4458925
OpenPGP Key ID: 0x0E8CE481
------------------------------
Date: Sun, 22 Oct 2000 02:37:09 GMT
From: jxavier@jxavier.vservers.com (jxavier)
Subject: Simple file/open/print help please
Message-Id: <39f252c8.515776377@news.lightrealm.com>
Still new to perl, going good back can't get a simple print to file to
work: Can someone tell me what I'm doing wrong please cause I cant
figure it out =( Here's the script:
print "Please enter your name";
$name = <STDIN>;
chop $name;
system("touch /usr/local/testperl/namefile");
$namer="/usr/local/testperl/namefile";
open LNAME, $namer or die "File $namer Does Not Exist";
print LNAME "$name";
close LNAME;
Everything seems to be fine, it creates the file and opens it but it
doesnt print the variable to the file?? I have also tried:
print LNAME $name;
which didnt work.
And just to be sure the variable wasnt empty for some reason, I tried
open LNAME, $namer or die "File $namer Does Not Exist";
print LNAME "$name";
print $name;
close LNAME;
and it prints the name to the screen fine, it just doesnt write it to
the file.
Can someone please tell me what I did wrong.
Thanks in advance!
------------------------------
Date: Sun, 22 Oct 2000 05:28:21 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Simple file/open/print help please
Message-Id: <x74s25phqi.fsf@home.sysarch.com>
>>>>> "j" == jxavier <jxavier@jxavier.vservers.com> writes:
j> open LNAME, $namer or die "File $namer Does Not Exist";
you didn't open the file for output.
perldoc -f open
perldoc perlopentut
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 22 Oct 2000 00:17:09 -0400
From: "none" <none@nospam.com>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <bItI5.2466$bM2.3659@newsfeed.slurp.net>
Hey, dude thanks for the criticism. Yes, it is a homework assignment, yes I
have blown 4 hours researching this, yes the teacher is out of town this
weekend, yes it is due Monday. I don't think getting help on this little
bit is asking too much, but since it is to you, don't respond. I have 10
years of Cobol, CICS, VSAM, DB2 and would blow your doors off there and make
you look like a fool.
Lighten up. And the model for this is straight from the teacher, which no
one would ever accuse you of being.
And as for the Cgi.pm, we haven't covered that yet, so, like I said, I AM a
beginner, just like you are in interacting with others in a respectful way.
You have to be a guru cause they'd never hire you based on personality.
"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7aebxpx4j.fsf@home.sysarch.com...
> >>>>> "n" == none <none@nospam.com> writes:
>
> n> All this has to do is COUNT the freakin numer of boxes that were
> n> checked for toppings - all it ever shows is 1. I've tried
> n> everything, including adding spaces after the topping value in the
> n> form, etc. Anyway to get this to work, I've only wasted around 4
> n> hours on it.
>
> n> Thanks. (see bottom part of program for 'toppings' - that's what
> n> I'm trying to count) also in sub order_form_pizza you can see where
> n> I am mixing and matching values (with space, with comma, without,
> n> etc) trying to get something to work. None of it does. $test has
> n> a value of 1 when I display it. aline,s1line,sline,toptot are all
> n> blank.
>
>
> i'll have a large with pepperoni and mushrooms, please. also an order of
> CGI.pm and use strict on the side. mmmm, i smell a homework assignment
> in the oven. too bad, i don't do homework.
>
> n> #!c:\perl\bin\perl.exe
> n> # This is pizzahome.pl
>
> n> require 'cgi-lib.pl';
>
> domino's is better than cgi-lib. call right now and they will deliver
> working code in 30 minutes or less!
>
> n> $now = localtime;
>
> not anymore. now is then and the future is now.
>
> n> &ReadParse(*input);
>
> n> sub name_address_form
> n> {
> n> print qq~
>
> check out the thread on here docs. that quoting style is like cold pizza
> and warm beer in the morning.
>
> n> sub order_form_thanks
> n> {
> n> if ($input{pizzasize} eq "Small") {
> n> $pizzacost = 7;
> n> } elsif ($input{pizzasize} eq "Medium") {
> n> $pizzacost = 9;
> n> } elsif ($input{pizzasize} eq "Large") {
> n> $pizzacost = 10;
> n> } else {
> n> $pizzacost = 12;
> n> }
>
> n> @line = @$input{toppings};
>
> do you have ANY idea what you are doing there? do you have ANY idea what
> cgi-lib might even be stuffing there? switch over to CGI.pm and read its
> docs. you might learn how to properly throw a pizza.
>
> n> $test = @line;
>
> n> $totalcost = $pizzacost + $toppingtotal;
>
> well, i don't see $toppingtotal anywhere else in this pile of
> dough. maybe you knead to set it somewhere.
>
> with coding skills like this, i can assure you future job at pizza hut!
> (but not working on their web site).
>
> uri
>
> --
> Uri Guttman --------- uri@sysarch.com ----------
http://www.sysarch.com
> SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX
Consulting
> The Perl Books Page -----------
http://www.sysarch.com/cgi-bin/perl_books
> The Best Search Engine on the Net ----------
http://www.northernlight.com
------------------------------
Date: Sun, 22 Oct 2000 05:23:16 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: still need help/beginner....pulling my hair !
Message-Id: <x77l71phyz.fsf@home.sysarch.com>
>>>>> "n" == none <none@nospam.com> writes:
n> Hey, dude thanks for the criticism. Yes, it is a homework
n> assignment, yes I have blown 4 hours researching this, yes the
n> teacher is out of town this weekend, yes it is due Monday. I don't
n> think getting help on this little bit is asking too much, but since
n> it is to you, don't respond. I have 10 years of Cobol, CICS, VSAM,
n> DB2 and would blow your doors off there and make you look like a
n> fool. Lighten up. And the model for this is straight from the
n> teacher, which no one would ever accuse you of being.
hey, this is not a do my homework for me place. we discuss and comment
on perl code here. you posted code, you get repsonses, you deal with it.
as for your 10 years, who cares? you are learning perl here and not
cobol. i won't even make any disparagin remarks about cobol. there have
been too many before.
n> And as for the Cgi.pm, we haven't covered that yet, so, like I
n> said, I AM a beginner, just like you are in interacting with others
n> in a respectful way. You have to be a guru cause they'd never hire
n> you based on personality.
well, i wouldn't hire you based on skill. your 10 years of code left you
with no skills in learning another computer language. your example code
never even set a key variable and you were asking why it wasn't set. try
using strict like i said and maybe the smart perl compiler will tell you
what you did wrong. ever use a cross reference generator? ever think
perl has something similar? DUH!!
on top of all that, you committed a cardinal sin here, which is to do a
full jeopardy quote. learn usenet netiquette or don't they teach that in
VSAM school?
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 22 Oct 2000 00:55:04 GMT
From: <danny@lennon.postino.com>
Subject: Re: use linux cmd 'passwd' with perl
Message-Id: <8stdt8$4cs$1@lennon.postino.com>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i586))
Jonas Ryser <jonas@free-support.de> wrote:
> I'm searching a possibility to use shell progs such as passwd or su in
> perl.
> I know how to start passwd, but if passwd asks for the password I can't
> print the passwd to the prog. I tried out that:
[snip]
Been there, ...
Found an easier route than Expect was to use the chpasswd command.
--
Danny Aldham Providing Certified Internetworking Solutions to Business
www.postino.com E-Mail, Web Servers, Web Databases, SQL PHP & Perl
------------------------------
Date: Sat, 21 Oct 2000 20:13:52 -0600
From: bowman <bowman@montana.com>
Subject: Re: use linux cmd 'passwd' with perl
Message-Id: <39F24D60.A3DCACCF@montana.com>
danny@lennon.postino.com wrote:
>
> Been there, ...
> Found an easier route than Expect was to use the chpasswd command.
Having spent many happy hours screwing around with Expect because a
previous
programmer chose to use it, I'd have to say almost anything has to be a
better solution than using Expect if you expect to have any
portablility.
------------------------------
Date: 22 Oct 2000 07:09:48 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Using text file to display form data
Message-Id: <8su3rs$2v4o$4@news.enteract.com>
Matt Perzel <thectrain@hotmail.com> wrote:
> #!/usr/bin/perl
No -w
No use strict
> #Get Data From Form *Works
No, not really. Your form-decoding code will break under certain
circumstances. Use CGI.pm instead.
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> $value =~ tr/+/ /;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $FORM{$name} = $value;
> }
> #Open the headings text file
> open(INF,"headings.dat")
> @ary = <INF>;
> close(INF);
At this point the elements of @ary will have trailing newlines, which will
interfere with the matching process. perldoc -f chomp
> #Write HTML
Comments should not state the bloody obvious.
> print "Content-type:text/html\n\n";
> print <<EndHdr;
> <html><head><title>FSA READ/WRITE TEST</title></head>
> <body>
> EndHdr
> #This is where I am trying to use the headings from the file to display the
> form data
> foreach $i (@ary) {
> print $FORM{'$i'};
You need to have a look at the section in perlop about quoting
operators. Those single quotes mean you're always using the literal
string consisting of a dollar sign followed by a lowercase 'i' as your
hash key.
> }
But you could eliminate the loop altogether with a hash slice:
print @FORM{@ary};
> #Here is the problem
> print <<EndFooter;
> </body>
> </html>
> EndFooter
------------------------------
Date: Sun, 22 Oct 2000 00:57:15 -0700
From: "Tom Heady" <thinc@punch.net>
Subject: Re: XML::XSLT ??
Message-Id: <6bxI5.3223$806.637098@news.uswest.net>
i use:
print $parser -> result_string;
"F.G." <nospam_fge@worldonline.dk> wrote in message
news:39F05013.BCBB98FC@worldonline.dk...
> Hello,
> working with XML::XSLT I have got som problems. My program:
>
> ----------------------
>
> #!/usr/bin/perl
> print "content-type: text/html\n\n";
>
> $xmlfile="14-1.xml";
> $xslfile="14-4.xsl";
>
> use XML::XSLT;
>
> my $parser = XML::XSLT->new ($xslfile, "FILE", warnings => "Active");
> $parser->transform_document ($xmlfile, "FILE");
>
> $parser->print_result;
>
> --------------------
>
> The problem:
> Working on a command line the output of the transformation is printed on
> the screen; using the program with my apache, there is no page-content
> to be shown. - It seems, that the "print_result" prints to STDOUT, but
> why does the webserver does not return the output?
>
> Thanks for you help.
> Franziskus
>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 4688
**************************************