[9709] in Perl-Users-Digest
Resend: Perl-Users Digest, Issue: 3302 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 1 20:27:27 1998
Date: Sat, 1 Aug 98 17:19:05 -0700
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, 1 Aug 1998 Volume: 8 Number: 3302
Today's topics:
perl error message soobak@my-dejanews.com
Re: perl error message (Abigail)
Re: perl error message (Tad McClellan)
Re: perl error message <jdporter@min.net>
Re: perl error message <thomas@x-tekcorp.com>
Re: perl error message <joneil@cks.ssd.k12.wa.us>
Re: Perl use in html documents (Ken Williams)
Re: Perl+MS SQL <support@ichat.com>
Perl, CGI program execution aacwn100@my-dejanews.com
Phila Oppty/$2500 Referral jgallagher@scgteam.com
Piping mail to a script that splits off attachments (Ma <p-nowak@eelink.net>
Re: Piping mail to a script that splits off attachments <aperrin@mcmahon.qal.berkeley.edu>
Please Help - CGI with Perl aacwn100@my-dejanews.com
Re: Please Help - CGI with Perl (Steve Linberg)
Please Help - Perl on the Web <aacwn100@york.ac.uk>
Please Help - Perl on the Web <aacwn100@york.ac.uk>
Please Help - Perl on the Web <aacwn100@york.ac.uk>
Please Help - Perl on the Web <aacwn100@york.ac.uk>
Please Help - Perl on the Web <aacwn100@york.ac.uk>
Re: Please Help - Perl on the Web (Tad McClellan)
Re: Please Help - Perl on the Web danzuck@my-dejanews.com
Re: printed & bound perl 5.005 manuals? <tchrist@mox.perl.com>
Printing letters <jonah@g-s.net>
Re: Printing letters (Nem W Schlecht)
Re: Printing letters <jdporter@min.net>
Re: Printing letters (Craig Berry)
Re: Printing letters <jonah@g-s.net>
Re: Printing letters (Ronald J Kimball)
problem assigning values to an array bolesbr1@memorialmed.com
Re: problem assigning values to an array <jdporter@min.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 31 Jul 1998 20:31:39 GMT
From: soobak@my-dejanews.com
Subject: perl error message
Message-Id: <6pt9jc$f04$1@nnrp1.dejanews.com>
Hi. I'm trying to run a perl script and have come up with the following error
message:
Literal @cornell now requires backslash at submit.pl line 21, within string
Execution of submit.pl aborted due to compilation errors.
I'm running Perl Win32. The script begins with
#!/usr/local/bin/perl
but that doesn't seem to be a problem. (Or is it and I just can't tell?) I
download this script from the Web and there are only a few variables that
should be changed (according to the author).
$backurl = "http://www.cornell.edu";
$backname = "Cornell";
$mailprog = "\wmailto\wmailto";
$youmail = "jim@cornell.edu";
$yourname = "jim";
$get_date = "\cgi-bin\givedate";
I have the variables set like above, and line 21 is the line that has $youmail
in it. Can anyone tell me why it's giving me this error message? Thanks in
advance.
Han
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 31 Jul 1998 21:06:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: perl error message
Message-Id: <6ptbkm$fc3$1@client3.news.psi.net>
soobak@my-dejanews.com (soobak@my-dejanews.com) wrote on MDCCXCV
September MCMXCIII in <URL: news:6pt9jc$f04$1@nnrp1.dejanews.com>:
++ Hi. I'm trying to run a perl script and have come up with the following error
++ message:
++
++ Literal @cornell now requires backslash at submit.pl line 21, within string
++ Execution of submit.pl aborted due to compilation errors.
Djee, it looks to me like it's saying '@cornell' now requires a backslash.
Maybe it does. Why don't you try?
++ $mailprog = "\wmailto\wmailto";
The program is called 'wmailtowmailto'? Odd name.
++ $get_date = "\cgi-bin\givedate";
You have controls characters in your path names? Are you sure?
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Fri, 31 Jul 1998 15:47:39 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: perl error message
Message-Id: <bhatp6.sse.ln@localhost>
soobak@my-dejanews.com wrote:
: Hi. I'm trying to run a perl script and have come up with the following error
: message:
: Literal @cornell now requires backslash at submit.pl line 21, within string
: Execution of submit.pl aborted due to compilation errors.
The error message itself tells you how to fix it.
Do you not understand what it says?
[snip up to line 21]
: $youmail = "jim@cornell.edu";
: . Can anyone tell me why it's giving me this error message?
The perldiag man page explains messages issued by perl.
Is there some part of the explanation given there that you
wanted to ask a question about?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 31 Jul 1998 21:07:22 GMT
From: John Porter <jdporter@min.net>
Subject: Re: perl error message
Message-Id: <35C232A4.3BD2@min.net>
soobak@my-dejanews.com wrote:
>
> Hi. I'm trying to run a perl script and have come up with the following error
> message:
>
> Literal @cornell now requires backslash at submit.pl line 21, within string
> Execution of submit.pl aborted due to compilation errors.
>
> $backurl = "http://www.cornell.edu";
> $backname = "Cornell";
> $mailprog = "\wmailto\wmailto";
> $youmail = "jim@cornell.edu";
> $yourname = "jim";
> $get_date = "\cgi-bin\givedate";
>
> I have the variables set like above, and line 21 is the line that has $youmail
> in it. Can anyone tell me why it's giving me this error message? Thanks in
> advance.
Are those lines above literally the way they appear in your script?
Because if so, the author of that script has made some serious
errors.
1. Go ahead and change all those double-quotes to single-quotes.
There's no interpolation going on, so no point in asking
the interpreter to do interpolation scanning.
That will solve the error you're getting.
(In the future, if you need a literal @ in a string which is
being subjected to variable interpolation, you can escape it
with a backslash: "jim\@cornell.edu")
2. $get_date is being assigned a value of "\007i-bingivedate",
because "\cg" is character 007 (octal), i.e. control-G.
The problem is the backslashes. Change them to forward slashes.
It should work, even on Dos/Win systems. (If you still have
problems with the path, you can put backslashes, but they must
then be escaped with backslashes: "\\cgi-bin\\givedate".
But that's a last resort, because it's not portable. Even URLs
will choke on a path that looks like that.)
By the way, does the program "use CGI;"?
I notice it doesn't have a -w on the command line.
For debugging purposes you might want to add it.
Also, you may find "use diagnostics;" helpful.
--
John Porter
------------------------------
Date: Fri, 31 Jul 1998 16:12:12 -0500
From: Thomas Rock <thomas@x-tekcorp.com>
Subject: Re: perl error message
Message-Id: <35C2332C.4343@x-tekcorp.com>
> Literal @cornell now requires backslash at submit.pl line 21, within string
> Execution of submit.pl aborted due to compilation errors.
>
> $backurl = "http://www.cornell.edu";
> $backname = "Cornell";
> $mailprog = "\wmailto\wmailto";
> $youmail = "jim@cornell.edu";
> $yourname = "jim";
> $get_date = "\cgi-bin\givedate";
Just make that:
$youmail = "jim\@cornell.edu";
and you should be okay.
--
Thomas Rock
X-Tek Corporation
www.x-tekcorp.com
------------------------------
Date: Fri, 31 Jul 1998 15:08:30 -0700
From: Jerome O'Neil <joneil@cks.ssd.k12.wa.us>
To: soobak@my-dejanews.com
Subject: Re: perl error message
Message-Id: <35C2405E.23328BBA@cks.ssd.k12.wa.us>
soobak@my-dejanews.com wrote:
> Literal @cornell now requires backslash at submit.pl line 21, within string
> Execution of submit.pl aborted due to compilation errors.
> $backurl = "http://www.cornell.edu";
> $backname = "Cornell";
> $mailprog = "\wmailto\wmailto";
> $youmail = "jim@cornell.edu";
> $yourname = "jim";
> $get_date = "\cgi-bin\givedate";
Perl doesnt know if @cornell is a list or if it should be interpreted
literaly. You should escape the @ character so perl knows what you
mean. Or you could use single quotes, which don't do variable
interpolation.
So the follwing should all work.
$youmail = "jim\@cornell.edu"; # Cleaner as qq{jim\@corenell.edu};
$youmail = 'jim@cornell.edu'; # Cleaner as q{jim@cornell.edu};
Good Luck!
Jerome O'Neil
------------------------------
Date: Wed, 29 Jul 1998 19:06:28 -0400
From: ken@forum.swarthmore.edu (Ken Williams)
Subject: Re: Perl use in html documents
Message-Id: <ken-2907981906280001@news.swarthmore.edu>
Also check out the SSI (server-side-includes) capabilities of your web server:
<html>...
<!--#exec cmd="/your/script/here.pl" -->
<more html>...
In article <Pine.HPP.3.95.980727185539.5074A-100000@homer.louisville.edu>,
Eric S Keyes <eskeye01@homer.louisville.edu> wrote:
>I somewhat can use perl and the book I am learnign from does not help with
>this.
>
>My problem in an example:
>
><html>
><body 'bla bla bla'>
>Welcome to my page.
>
><* Run a perl script to insert data here*>
>
>Thank you and please read my guestbook.
></body>
></html>
>
>To clarify I would like to load a script into the html doc, right now
>all I know is how to to is make the perl script create a new html doc and
>I do not want to do this.
>
>Please help.
>
>Eric S. Keyes
>@}-,-}- BlkRose @}-,-}-
>
>Mail: erickeyes@louisville.edu
>Web : http://www.louisville.edu/~eskeye01
>
>"You can push the meek around but those with a strong will, never budge."
------------------------------
Date: Fri, 31 Jul 1998 11:54:04 -0500
From: John Warner <support@ichat.com>
Subject: Re: Perl+MS SQL
Message-Id: <35C1F6AC.6543C163@ichat.com>
The DBI module is a good start. However, be careful on what you do. Microsoft
bought the code to Sybase 10 and used that as the basis for MS SQL. Using
functionality from newer Sybase versions may not work at all or may not do what
you want.
mspitzer@stones.com wrote:
> > Hi!
> > Please, help: is there any module that gives opportunity to work with
> > Microsoft SQL Server (I need to write a program that connects Internet user
> > and database)
> >
> > Thanx!
> >
> >
> try the sybase DBI module. I read that it might work.
>
> Good luck,
> marc
------------------------------
Date: Thu, 30 Jul 1998 16:11:15 GMT
From: aacwn100@my-dejanews.com
Subject: Perl, CGI program execution
Message-Id: <6pq5v3$6jp$1@nnrp1.dejanews.com>
Can anyone help?
I want to use perl to execute a program, which is normally run from a unix
prompt in the form of a command line. What goes into the command line will be
collected via a 'form' and just stured in variables, but how do I execute a
program (with a file that the user has already uploaded!) and then get the
output of that program (which will be another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible to use
it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 31 Jul 1998 14:45:27 GMT
From: jgallagher@scgteam.com
Subject: Phila Oppty/$2500 Referral
Message-Id: <6psla7$h3q$1@nnrp1.dejanews.com>
My name is John Gallagher. I work for Software Consulting Group. SCG is an
Information Technology Consulting firm in the Philadelphia area that has been
experiencing explosive growth over the past several years. SCGs growth has
created several excellent opportunities for skilled professionals working on
various development projects. We are looking for looking for Developers,
Project Leaders and Sr. Project Managers with skills in any of the following
areas: WEB APPLICATION DEVELOPMENT(HTML, Perl, Java, CGI, Cold Fusion) and
OBJECT ORIENTED DEVELOPMENT(Corba, C++). SCG offers tremendous growth
potential as well as an exceptional benefits plan (ESOP Plan, Profit Sharing,
Employee Bonuses, 401k, etc.). I can be reached at 610-892-8920 or via e-mail
to discuss these opportunities further.
If you are not interested personally, SCG has an External Referral Program
that will pay $2500 for each successful hire.
Sincerely,
John Gallagher
Director of Recruiting
Software Consulting Group
Jgallagher@scgteam.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Sat, 01 Aug 1998 16:02:36 GMT
From: Paul Nowak <p-nowak@eelink.net>
Subject: Piping mail to a script that splits off attachments (Mailtools)
Message-Id: <35C33CD6.5860A563@eelink.net>
I am running qmail and I can direct email to an executable without a
problem.
My question: has anyone written a perl tool to allow me to have a perl
script split off any email attachements and place them in specific
direcortries based on information in the body or header of the email?
I understand Mailtools has some of this but I wasn't sure Mailtools was
the best place to start.
Thanks,
Paul Nowak
p-nowak@eelink.net
------------------------------
Date: Sat, 01 Aug 1998 09:26:53 -0700
From: Andrew Perrin <aperrin@mcmahon.qal.berkeley.edu>
Subject: Re: Piping mail to a script that splits off attachments (Mailtools)
Message-Id: <35C341CD.6764C338@mcmahon.qal.berkeley.edu>
I believe the munpack utility does this pretty cleanly, but I can't say
I've played with it too much; check it out.
munpack - unpack messages in MIME or split-uuencode format
SYNOPSIS
munpack [ -f ] [ -q ] [ -t ] [ -C directory ] [ filename ...
]
DESCRIPTION
The munpack program reads each RFC-822 message filename and
writes all non-text MIME parts or split-uuencoded files as
files. If no filename argument is given, munpack reads from
standard input.
Paul Nowak wrote:
> I am running qmail and I can direct email to an executable without a
> problem.
>
> My question: has anyone written a perl tool to allow me to have a perl
> script split off any email attachements and place them in specific
> direcortries based on information in the body or header of the email?
>
> I understand Mailtools has some of this but I wasn't sure Mailtools was
> the best place to start.
>
> Thanks,
>
> Paul Nowak
> p-nowak@eelink.net
--
-------------------------------------------------------------
Andrew J. Perrin - NT/Unix/Access Consulting - (650)938-4740
aperrin@mcmahon.qal.berkeley.edu (Remove the Junk Mail King
http://socrates.berkeley.edu/~aperrin to e-mail me)
e-mail wheres-andy@socrates.berkeley.edu to find me!
-------------------------------------------------------------
------------------------------
Date: Thu, 30 Jul 1998 16:13:14 GMT
From: aacwn100@my-dejanews.com
Subject: Please Help - CGI with Perl
Message-Id: <6pq62q$6kq$1@nnrp1.dejanews.com>
Can anyone help?
I want to use perl to execute a program, which is normally run from a unix
prompt in the form of a command line. What goes into the command line will be
collected via a 'form' and just stured in variables, but how do I execute a
program (with a file that the user has already uploaded!) and then get the
output of that program (which will be another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible to use
it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 30 Jul 1998 16:02:38 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Please Help - CGI with Perl
Message-Id: <linberg-3007981602380001@projdirc.literacy.upenn.edu>
In article <6pq62q$6kq$1@nnrp1.dejanews.com>, aacwn100@my-dejanews.com wrote:
> Can anyone help?
>
> I want to use perl to execute a program, which is normally run from a unix
> prompt in the form of a command line. What goes into the command line will be
> collected via a 'form' and just stured in variables, but how do I execute a
> program (with a file that the user has already uploaded!) and then get the
> output of that program (which will be another file) back to the user.
Security problems aside:
$command = "foo.exe " . $arguments;
$output = `$command`;
...
right?
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Thu, 30 Jul 1998 16:47:32 +0100
From: Andy Ng <aacwn100@york.ac.uk>
Subject: Please Help - Perl on the Web
Message-Id: <35C09593.F4672A01@york.ac.uk>
Can anyone help?
I want to use perl to execute a program, which is normally run from a
unix prompt in the form of a command line. What goes into the command
line will be collected via a 'form' and just stured in variables, but
how do I execute a program (with a file that the user has already
uploaded!) and then get the output of that program (which will be
another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible
to use it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
------------------------------
Date: Thu, 30 Jul 1998 16:45:03 +0100
From: Andy Ng <aacwn100@york.ac.uk>
Subject: Please Help - Perl on the Web
Message-Id: <35C094FE.580852A3@york.ac.uk>
Can anyone help?
I want to use perl to execute a program, which is normally run from a
unix prompt in the form of a command line. What goes into the command
line will be collected via a 'form' and just stured in variables, but
how do I execute a program (with a file that the user has already
uploaded!) and then get the output of that program (which will be
another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible
to use it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
------------------------------
Date: Thu, 30 Jul 1998 16:48:15 +0100
From: Andy Ng <aacwn100@york.ac.uk>
Subject: Please Help - Perl on the Web
Message-Id: <35C095BF.9E8AE3FE@york.ac.uk>
Can anyone help?
I want to use perl to execute a program, which is normally run from a
unix prompt in the form of a command line. What goes into the command
line will be collected via a 'form' and just stured in variables, but
how do I execute a program (with a file that the user has already
uploaded!) and then get the output of that program (which will be
another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible
to use it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
------------------------------
Date: Thu, 30 Jul 1998 16:45:42 +0100
From: Andy Ng <aacwn100@york.ac.uk>
Subject: Please Help - Perl on the Web
Message-Id: <35C09526.96589BAB@york.ac.uk>
Can anyone help?
I want to use perl to execute a program, which is normally run from a
unix prompt in the form of a command line. What goes into the command
line will be collected via a 'form' and just stured in variables, but
how do I execute a program (with a file that the user has already
uploaded!) and then get the output of that program (which will be
another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible
to use it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
------------------------------
Date: Thu, 30 Jul 1998 16:40:21 +0100
From: Andy Ng <aacwn100@york.ac.uk>
Subject: Please Help - Perl on the Web
Message-Id: <35C093E5.57EA6273@york.ac.uk>
Can anyone help?
I want to use perl to execute a program, which is normally run from a
unix prompt in the form of a command line. What goes into the command
line will be collected via a 'form' and just stured in variables, but
how do I execute a program (with a file that the user has already
uploaded!) and then get the output of that program (which will be
another file) back to the user.
(the program is a sound processing one. I'm trying to make it possible
to use it on the Web!)
Please HELP!!
aacwn100@york.ac.uk
------------------------------
Date: Thu, 30 Jul 1998 11:31:10 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Please Help - Perl on the Web
Message-Id: <e47qp6.e88.ln@localhost>
[ Please post articles once only...]
Andy Ng (aacwn100@york.ac.uk) wrote:
: Can anyone help?
You can help yourself with this one.
: how do I execute a program (with a file that the user has already
: uploaded!) and then get the output of that program (which will be
: another file) back to the user.
perldoc -f qx
: (the program is a sound processing one. I'm trying to make it possible
: to use it on the Web!)
The above will tell you how to execute a command using perl.
There are other newsgroups for discussing Web specific things
(like where the files come from/go to).
: Please HELP!!
Yelling and pleading are not likely to increase your chances of getting help.
Just leave that part out of future posts.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 30 Jul 1998 18:13:27 GMT
From: danzuck@my-dejanews.com
Subject: Re: Please Help - Perl on the Web
Message-Id: <6pqd47$g8r$1@nnrp1.dejanews.com>
In article <35C09593.F4672A01@york.ac.uk>,
Andy Ng <aacwn100@york.ac.uk> wrote:
> Can anyone help?
>
> I want to use perl to execute a program, which is normally run from a
> unix prompt in the form of a command line. What goes into the command
> line will be collected via a 'form' and just stured in variables, but
> how do I execute a program (with a file that the user has already
> uploaded!) and then get the output of that program (which will be
> another file) back to the user.
>
> (the program is a sound processing one. I'm trying to make it possible
> to use it on the Web!)
>
> Please HELP!!
> aacwn100@york.ac.uk
>
>
If you are calling the perl program directly from the form <FORM
ACTION=script.pl METHOD=POST/GET> then you will have to add a POST or GET
routine in your perl script. Many examples of this at http://www.perl.com
and one below. Once you have parsed you FORM items, simply call the program
using $rc=system("program var var") or $textout=`program var var` (backtick).
If your program writes an output file, then simply open the output file and
print the entire file to STDOUT. Be sure to have "Content-type: text/html"
as first printed line. Below is an example:
#===========================================================================
# Get the data from ENV/STDIN.
#===========================================================================
sub GetQueryString
{
$request_method = $ENV{'REQUEST_METHOD'};
#--------------------------------------------------
# Get the passed data from client.
#--------------------------------------------------
if( $request_method eq "GET" ) {
$query_string = $ENV{'QUERY_STRING'};
} elsif( $request_method eq "POST" ) {
read( STDIN, $query_string, $ENV{'CONTENT_LENGTH'} );
} else {
&ExitErrHTML( 500, "Server Error", "Server uses unsupported
method: $request_method");
}
return $query_string;
}
#===========================================================================
# Parse the incoming data. Data in format "var=value&var=value&var=value"
#===========================================================================
sub parse_data_to_associative
{
local (*PASS_DATA) = @_;
local (@key_value_pairs, $key_value, $key, $value);
#-------------------------------------------------------------
# Parse the passed data. First split the list into var=value
# combinations, then put into associative array, add \0 to
# duplicate values. Spaces are passed as "+".
#-------------------------------------------------------------
@key_value_pairs = split(/&/, $query_string);
foreach $key_value (@key_value_pairs)
{
($key, $value) = split(/=/, $key_value);
$key=~ tr/a-z/A-Z/;
$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
if( !defined($value) || length($value) < 1 ) {
$value = "NOVALUE";
}
if( defined($PASS_DATA{$key}) ) {
$PASS_DATA{$key} = join("\0", $PASS_DATA{$key}, $value);
} else {
$PASS_DATA{$key} = $value;
}
}
}
#===========================================================================
# Parse the incoming data. Data in format "var=value&var=value&var=value"
#===========================================================================
sub check_for_empty_values
{
local (*assoc_value_array) = @_;
chomp( $SearchOn=$assoc_value_array{"SEARCH_ON"} );
ExitErrHTML(100, "Missing Data", "You must choose a query option")
if( $SearchOn eq "NOVALUE" || ! $SearchOn );
}
sub printsomething
{
print "Content-type: text/html", "\n\n";
print "<title>My titem</title> \n";
open(FILE,.....);
while( $line=<FILE> ) {
print STDOUT $line;
}
exit(0);
}
}
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 31 Jul 1998 14:09:43 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: printed & bound perl 5.005 manuals?
Message-Id: <6psj77$ajs$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, karl@gnu.org writes:
:Is there anywhere to buy a nice bound and printed copy of the Perl 5.005
:documentation? Failing that, has anyone produced a nice single dvi or
:PostScript file from it?
:
:The result of pod2man was even more pages and even uglier output for
:printing and reading.
You should look into the roffitall script in the pod directory, which can
be used to make a book.
--tom
--
If you can stick your finger in it, you can hang from it. --Andrew Hume
------------------------------
Date: Fri, 31 Jul 1998 19:58:02 GMT
From: "Jonah Olsson" <jonah@g-s.net>
Subject: Printing letters
Message-Id: <elpw1.302$JR2.374878@nntpserver.swip.net>
Hi!
How do I print out letter by letter from an array?
Thanks in advance.
--
Regards,
Jonah Olsson
Generation Software
http://www.g-s.net
------------------------------
Date: 31 Jul 1998 16:36:34 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: Printing letters
Message-Id: <6ptdd2$hnu@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Jonah Olsson <jonah@g-s.net> wrote:
>
>How do I print out letter by letter from an array?
You should give a little more info on your specific problem when posting to
a newsgroup. Here's the literal answer to your question:
@words=qw(larry wall tom christiansen randal schwartz nem schlecht);
for (@words)) {
my(@s)=split(//,$_);
for (@s) {
print"$_\n"
}
}
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
"Perl did the magic. I just waved the wand."
------------------------------
Date: Fri, 31 Jul 1998 20:35:04 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Printing letters
Message-Id: <35C22B11.5C2@min.net>
Jonah Olsson wrote:
>
> How do I print out letter by letter from an array?
That question doesn't quite make sense to me.
How have you tried to do it, and what results did you get?
--
John Porter
------------------------------
Date: 31 Jul 1998 21:17:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Printing letters
Message-Id: <6ptc8g$4cj$1@marina.cinenet.net>
Jonah Olsson (jonah@g-s.net) wrote:
: How do I print out letter by letter from an array?
Depends on what's in the array. If it's an array of strings or things you
want to see as strings, and you want to pull each string into individual
chars and print them out, here's one approach. You might be able to
borrow parts of it to accomplish whatever it is you actually want to do.
my @text = ("Here is some\n", "text to chew\n", "on as a demo\n");
foreach (@text) {
print join '|', split //;
}
This prints all the chars on each line, separated by | characters.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Sat, 01 Aug 1998 09:39:22 GMT
From: "Jonah Olsson" <jonah@g-s.net>
Subject: Re: Printing letters
Message-Id: <enBw1.491$JR2.775180@nntpserver.swip.net>
Sorry for beeing so incomplete. Here's more info about my problem:
I opened a textfile using the 'open' statement and I put the text in an
array. Like this:
open (FILE, "$fil") || die "Can't open $file\n" ;
@contents = <FILE>;
close (FILE);
Then let say I want to print out the file letter by letter and not line by
line as you usually do. I just can't get that work.
I hope this one make more sense. Otherwise, I actually don't know how to
explain it.
Regards,
Jonah Olsson
Generation Software
John Porter <jdporter@min.net> wrote in message 35C22B11.5C2@min.net...
>Jonah Olsson wrote:
>>
>> How do I print out letter by letter from an array?
>
>That question doesn't quite make sense to me.
>How have you tried to do it, and what results did you get?
>
>--
>John Porter
------------------------------
Date: Sat, 1 Aug 1998 14:31:59 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Printing letters
Message-Id: <1dd36hx.18omjro1bonbaN@bay1-241.quincy.ziplink.net>
Jonah Olsson <jonah@g-s.net> wrote:
> Sorry for beeing so incomplete. Here's more info about my problem:
>
> I opened a textfile using the 'open' statement and I put the text in an
> array. Like this:
>
> open (FILE, "$fil") || die "Can't open $file\n" ;
Yay for checking the return value of open! It will be even more useful
if you change it to:
open (FILE, "$fil") || die "Can't open $file: $!\n";
$! (in a string context) will give the error message explaining why the
die failed.
> @contents = <FILE>;
> close (FILE);
>
> Then let say I want to print out the file letter by letter and not line by
> line as you usually do. I just can't get that work.
Do you want to print each letter on a separate line, or pause after
printing each letter, or what?
Either way, since you're not concerned with the original line breaks,
you should read the file into a string instead of an array:
{
local $/;
$contents = <FILE>;
}
For the former, you could use substr and print each character followed
by a newline:
for ($i=0; $i<length $contents; ++$i) {
print substr($contents, $i, 1), "\n";
}
For the latter, you could use substr and print each character, then
sleep for a brief period:
for ($i=0; $i<length $contents; ++$i) {
print substr($contents, $i, 1);
sleep 1;
}
Are either of those what you had in mind?
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Fri, 31 Jul 1998 19:05:21 GMT
From: bolesbr1@memorialmed.com
Subject: problem assigning values to an array
Message-Id: <6pt4hh$7k0$1@nnrp1.dejanews.com>
Hello all,
I am working on my first major Perl program and am having trouble getting an
array to work like I want it to. Here is my code:
if ($line =~ /^USER/ && $count <= 6 ) {
@header[$headercount]=@wholefile[$headercount + 6];
print "Header $headercount:\n@header[$headercount]";
}
I want to assign to @header the first six lines of text of each page of the
file that I am reading. When I run through the debugger, I do see the
if/then condition is satisfied, so I know that it does go throught the loop.
But when the print statement is run, all I get is "Header 0:" and that's it.
The number is correct, but I don't get the six lines of output that I want to
go along with it.
Any help would be greatly appreciated! TIA!
[\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/]
[\/]Brandon Boles [\/] The expressed opinion's are[\/]
[\/]Systems Administrator [\/] entirely my own, not of my[\/]
[\/]Memorial Medical Center [\/] employer or any of its[\/]
[\/]bolesbr1@memorialmed.com [\/] affiliations.[\/]
[\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/][\/]
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 31 Jul 1998 19:56:35 GMT
From: John Porter <jdporter@min.net>
Subject: Re: problem assigning values to an array
Message-Id: <35C2220C.6FA6@min.net>
bolesbr1@memorialmed.com wrote:
>
> if ($line =~ /^USER/ && $count <= 6 ) {
> @header[$headercount]=@wholefile[$headercount + 6];
> print "Header $headercount:\n@header[$headercount]";
> }
You've forgotten that to access (assign to/from) a single
array element, you use the '$' scalar notation. Try this:
if ( $line =~ /^USER/ && $count <= 6 ) {
$header[$headercount] = $wholefile[$headercount + 6];
print "Header $headercount: $header[$headercount]\n";
}
Also, I wonder if you're confused/inconsistent with your
$counter/$headercounter variables.
And where does $line come from? Is it one of the
elements in @wholefile?
> I want to assign to @header the first six lines of text
> of each page of the file that I am reading.
The simple way to do that is to assign an array slice:
@header = @wholefile[0..5];
But from your example, I think there's actually more
going on than you've told us about.
--
John Porter
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 3302
**************************************