NAME
beginners-faq - FAQ for the beginners-cgi mailing list
1 - Administriva
1.1 - I'm not subscribed - how do I subscribe?
Send mail to [EMAIL PROTECTED]
You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email
Replace those question marks with shift. The line should look like this.
my @local_array = shift;
Jordan
On Thu, 2003-02-13 at 15:18, Stephen Spalding wrote:
Hello all,
I have a question about perl. I'm trying to pass an
array into a subroutine, but I don't know what the
proper way to
Oh, sorry. Be sure to pass the array as a ref. Like this.
PRINT_CONTENTS(\@sample_array);
Jordan
On Thu, 2003-02-13 at 15:18, Stephen Spalding wrote:
Hello all,
I have a question about perl. I'm trying to pass an
array into a subroutine, but I don't know what the
proper way to receive it
Stephen Spalding wrote:
Hello all,
I have a question about perl. I'm trying to pass an
array into a subroutine, but I don't know what the
proper way to receive it in the subroutine is. Below
is an example of what I'm trying to do. The ???
represents what I do not know what to put in.
I tried your line and the only thing that happens is I get an error page in
the browsererror 500 and the only thing I can find in the log files is
premature end of script headers. I have tried the script with and without
the -T set still no luck either way.
Thanks
Tom
On Wed, 12 Feb 2003
Tom McKellips wrote:
I tried your line and the only thing that happens is I get an error page in
the browsererror 500 and the only thing I can find in the log files is
premature end of script headers. I have tried the script with and without
the -T set still no luck either way.
Had you
Hello all,
I have a question about perl. I'm trying to pass an
array into a subroutine, but I don't know what the
proper way to receive it in the subroutine is. Below
is an example of what I'm trying to do. The ???
represents what I do not know what to put in.
@sample_array = ('hi', 'there',
Pass it as a referance.
#!/usr/bin/perl -w
@sample_array = ('hi', 'there', 'steve');
$sample_array_ref = \@sample_array;
PRINT_CONTENTS($sample_array_ref);
exit 0;
sub PRINT_CONTENTS{
my $local_ref = $_[0];
foreach (@{$local_ref}){
print string = $_\n;
}
}
You can also clean the
Gan Uesli Starling wrote:
I see hundreds of these error messages from -w switch...
Character in C format wrapped at ./FYBB_DirTree.pm line 867.
...here is line 867...
$buf = pack( 'C*', @{ $bufRfs[0] } );
...but my program (an encryption routine) works jus fine. I
packing with C* only
Hello,
I have a Hash of Data.
The Key lies in an Array of on Array of Arrays or something like that.
How do I use it???
if ($myhash{$ArrayOfKeys[2][4][1]}){
print soo\n;
}
or
if ($myhash{$ArrayOfKeys[2][4][1]}){
print joo\n;
}
or how?
Thanks!
--
To unsubscribe, e-mail: [EMAIL
Lielie Meimei wrote:
Hello..
I'm still newbie.
Could u help me to see why in the script perl here can
not compiled, please help me.
==Begin of indexsite.pl ==
#!/usr/bin/perl
Please always:
use strict;
use warnings;
$directory='/root/tmp';
[snip
Why is it that the beginners-digest emails are properly displayed ONLY
by MS Outlook? If I look at the digest email in Outlook, it comprises a
number of attachments who are themselves the actual email postings. I
open an attachment and can reply to the original sender.
This is not the case in
Lance said:
Is there a way to determine a type of variable? i.e. If I want to test a
variable for what type it is: scarlar, array, hash, arrayref, hashref,
etc.
The sigil will tell you the type, but if you have a scalar and want to
know what it references, use ref().
perldoc -f ref
--
on Thu, 13 Feb 2003 00:21:03 GMT, [EMAIL PROTECTED] (Gan Uesli
Starling) wrote:
Am wanting to get a list of files in a directory, but only
files which are not themselves further sub-directories.
When I do this...
opendir(DIR, $this_path) or die Can't opendir $this_path: $!;
on Thu, 13 Feb 2003 13:17:03 GMT, [EMAIL PROTECTED] (Zeus Odin)
wrote:
I am trying to avoid Windows. A little help will be greatly
appreciated.
Point your newsreader at nntp.perl.org.
--
felix
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I have created the following data structure:
%mailings = ( tv = { mail_demo_key = Demo License Key for TotalView,
mail_thank_you = Thank you for downloading
TotalView,
pdf = LOCATION_OF_PDF,
location=
Hello list,
I've started writing a little script to automate daily procedures (check backup
status, look for AV dat updates, disk space, etc). I have a mix of Linux and Windows
machines. I'm not having trouble with the Linux boxes, but I'm kind of stumped as to
the best way to retrieve
On Thu, 13 Feb 2003 09:21:13 -0500, Barry Kingsbury [EMAIL PROTECTED] wrote:
snip
Can some guru explain?
They have already ;-)...have you done your reading?
perldoc perlreftut
perldoc perlref
These are two excellent starting places, and
On Feb 13, Barry Kingsbury said:
I have created the following data structure:
%mailings = ( tv = { mail_demo_key = Demo License Key for TotalView,
mail_thank_you = Thank you for downloading
TotalView,
pdf = LOCATION_OF_PDF,
Hi
I want to to file handling in perl.In that I have one file which contains some
lines.Now I want to modify some of lines like..
My file conatins
line one
line two
line three
password=password;
Login Id =xyz
line 6
and so on
if i want to write new passord and login id then how can i do that?
on Thu, 13 Feb 2003 14:29:41 GMT, [EMAIL PROTECTED] (Brian
McGraw) wrote:
... but I'm kind of stumped as to the best way
to retrieve disk space data from my Win machines.
Have a look at Dave Roth's Win32::AdminMisc module.
http://www.roth.net/perl/adminmisc/#GetDriveSpace
I'm using
I am trying to build Compress-Zlib-1.19 on sco openserver 5. GCC is
installed from skunkware but it seems to try and use CC. I do not have
the sco development software installed so CC is not there.
Running Perl 5.6.0 which is a whole other problem I cant get Perl 5.8 to
build on this machine
I have a box that's running perl version 5.005_03 and I'ld like to upgrade
to the latest version.
What's the best way to accomplish this and maintain access to my currently
installed modules?
I'm doing this on a SUN box. Also, this particular box is behind a firewall
and doesn't have internet
Pankaj Kapare wrote:
Hi
I want to to file handling in perl.In that I have one file
which contains some lines.Now I want to modify some of lines like..
My file conatins line one
line two
line three
password=password;
Login Id =xyz
line 6
and so on
if i want to write new passord and
Getting the software isn't that hard, just a question of using sneaker
net.
But I would like to avoid having to rebuild all my modules if possible.
Is it feasible to install 5.6 (someone has mentioned that 5.8 isn't binary
compatible with older versions) and then use symlinks to point to the old
Not tested. I am sure there is a more elegant way to do this but this
should do the trick. It will create a new file with the changes. If you
want to edit it inline you will have to do some research.
#Open files for input and output
open (IN,myfile) or die Can not open file\n;
I need to be able read the first few lines of a binary test file (i.e. .staff form).
Does anyone
know how to do this in purl.
Sean
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This doesn't work with activestate on windows.
perldoc -q 'change one line'
Output
No documentation for perl FAQ keyword `'change' found.
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 10:56 AM
To: 'Pankaj Kapare'; [EMAIL PROTECTED]
John W. Krahn wrote:
Gan Uesli Starling wrote:
Am wanting to get a list of files in a directory, but only
files which are not themselves further sub-directories.
When I do this...
opendir(DIR, $this_path) or die Can't opendir $this_path: $!;
You are opening the directory with
On Thu, 13 Feb 2003 11:49:04 -0500, Sean Sugrue wrote:
I need to be able read the first few lines of a binary test file (i.e.
.staff form).
Please define what is a line for you in a binary file.
If it is just a normal line (ending on the line separator),
you just can do the normal way,
e.g.
Paul Kraus wrote:
This doesn't work with activestate on windows.
perldoc -q 'change one line'
Output
No documentation for perl FAQ keyword `'change' found.
Use double quotes for brain-dead windoze:
perldoc -q change one line
(I just noticed this FAQ answer has changed significantly
From: Richard Fernandez [EMAIL PROTECTED]
Getting the software isn't that hard, just a question of using
sneaker net. But I would like to avoid having to rebuild all my
modules if possible.
Is it feasible to install 5.6 (someone has mentioned that 5.8 isn't
binary compatible with older
I am having a problem knowing how to force a top of page. I was using
format
statements for my report by I can change it to printf if there is a way. My
report is for various clients and I want to run the job once for all the
clients but go to top of page and start the page numbers over at
On Thu, 13 Feb 2003 10:17:47 -0500, Paul Kraus [EMAIL PROTECTED] wrote:
I am trying to build Compress-Zlib-1.19 on sco openserver 5. GCC is
installed from skunkware but it seems to try and use CC. I do not have
the sco development software
Where can I get a good TK tutorial, in order to learn the TK basics ?
TIA,
YG
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Try Here:
http://www.perldoc.com/perl5.6/pod/perlfaq5.html
-rm-
- Original Message -
From: Paul Kraus [EMAIL PROTECTED]
To: 'Bob Showalter' [EMAIL PROTECTED]; 'Pankaj Kapare'
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, February 13, 2003 10:55 AM
Subject: RE: File handling
I'm interested in doing the equivalent of a horizontal cat on a bunch of files.
That is, instead of listing them one after another, I'd like them catted next to
each other horizontally (tab separated).
e.g.
file t1
0
1
2
file t2
10 15
11
12
13
14
file t3
20
21
% hcat t1 t2 t3
0 10 15
Check out Data::Dumper, you'll love it! www.perldoc.com
Pass it a ref and it prints out a pretty data structure recursively, so you
don't have to! Ain't Perl Grand?
Barry Kingsbury [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I have created the following
Bryan Harris wrote:
I'm interested in doing the equivalent of a horizontal cat on a bunch of
files. That is, instead of listing them one after another, I'd like them
catted next to each other horizontally (tab separated).
% hcat t1 t2 t3
0 10 15 20
1 11 21
2 12
13
I would like to pack some modules with my program.
I've learned about use lib qw(/mydirto/mylibrary/);
for simple modules. Now I have an module that has
several directories (Crypt::OpenPGP). The program
can't find the module in the library when I simply
upload it to the server.
I've
Hello,
I've got a Perl program that create an HTML page and I would like to get in
the Perl program the value that is selected in a combo list (HTML Select
Tag).
Thanks a lot!!!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Bryan Harris wrote:
I'm interested in doing the equivalent of a horizontal cat on a bunch of
files. That is, instead of listing them one after another, I'd like them
catted next to each other horizontally (tab separated).
e.g.
file t1
0
1
2
file t2
10 15
11
12
13
14
file
hi all,
if i want to make a standalone executable of my perl program how do i do
that with perlcc ???
or any other way to generate machinecoded executable?
kindly enlighten me --
regards,
KM
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Bryan Harris wrote:
I'm interested in doing the equivalent of a horizontal cat on a
bunch of files. That is, instead of listing them one after another,
I'd like them catted next to each other horizontally (tab
separated).
I'd like it to be able to work on any number of files, and they
Not sure about how to do it via perlcc, but
you can alternatively try: http://www.perl2exe.com/
On Fri, 2003-02-14 at 08:08, [EMAIL PROTECTED] wrote:
hi all,
if i want to make a standalone executable of my perl program how do i do
that with perlcc ???
or any other way to generate
Paul wrote:
One particular thing to watch -- most systems have a limit on how many
filehandles a process can have open at a time. To see your max, (and as
a template for another solution), try this:
use FileHandle;
while ($_ = new FileHandle deleteme) {
push @_, $_;
unlink
Hi,
I'm trying to get Spamassassin running on FreeBSD where
a 5.00503 Version of Perl is installed, however. I additionally
installed 5.6.1 which doesn't leaded to results cause of library
mismatch. So how can I get rid of the 5.005 Version without harming
the system?
Thanks a lot Tom
--
To
Guy P wrote:
Hello,
I've got a Perl program that create an HTML page and I would like to get in
the Perl program the value that is selected in a combo list (HTML Select
Tag).
You should read the documentation for the CGI module:
http://search.cpan.org/author/LDS/CGI.pm-2.91/CGI.pm
Patricia Hinman wrote:
I would like to pack some modules with my program.
I've learned about use lib qw(/mydirto/mylibrary/);
for simple modules. Now I have an module that has
several directories (Crypt::OpenPGP). The program
can't find the module in the library when I simply
upload it to
From: [EMAIL PROTECTED]
if i want to make a standalone executable of my perl program how do i
do that with perlcc ??? or any other way to generate machinecoded
executable? kindly enlighten me -- regards, KM
If you run
perldoc perlcc
you will get the documentation.
Including this
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a lot.
- tao
__
tao wang wrote:
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a lot.
/^\d+\.\d+/ which says anchor at
How about something like this?
/\d{0,3}\.\d{0,3}/
which should match 0-3 digits followed by a period followed by 0-3 digits.
You should be able to see how you can change it if you want to expand how
many digits to capture. You could also try:
/\d+\.\d+/
Which matches one or more digits
tao wang wrote:
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a lot.
\d.\d+
\d+.\d+
\d*.\d*
\d+\.+\d+
\d+\.*\d+
On Thu, Feb 13, 2003 at 04:39:17PM -0800, tao wang wrote:
hi,
I'm trying to write a script to match a pattern like
this: 1.10
I wrote [\d.]+, but this also match with pattern ...
, which has no number in it. Could somebody help me
with it? I'm new to perl and scripts. thanks a
From: [EMAIL PROTECTED]
if i want to make a standalone executable of my perl program how do i
do that with perlcc ??? or any other way to generate machinecoded
executable? kindly enlighten me -- regards, KM
If your standalone is for Win32, then this might do the
trick. I used to use it with
Lance wrote:
If I hafta pass in refs from loop1 2 and 3 all the way down the line, So Be
It. It just makes my argument list a little unsightly, is all.
Hi Lance,
You might want to re-examine this view. The process of passing by reference is not
something to just resign yourself to. It is
Dan Muey wrote:
That's exactly it, thanks you very much!
One more tiny little problem,
I have it grabbing the title, links and img tags perfectly except fot one minor snafu
It won't grab/parse img tags that are between a tags, IE an image that is a link.
I tried having it parse img's first
R. Joseph Newton wrote:
Lance wrote:
If I hafta pass in refs from loop1 2 and 3 all the way down the line, So Be
It. It just makes my argument list a little unsightly, is all.
It can also help you prevent confusion.
I agree with what you said, particularly about scalability and
Mark VanMiddlesworth wrote:
this is a script that systematically pings every host on the network,
and writes the output to the screen. If the -n arg is specified, it
will also write to a disk. What's wrong with the syntax, especially
line 12?
Why am I supposed to count to line 12, instead of
I have this line in one of my scripts:
if ( $pid = open( SWISH, '-|' ) )
Why am I opening -|? And what is it?
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Shaw, Steven wrote:
Hi, I'm looking for tutorials/sample-code/book-recommendations for learning about
exceptions, exception objects and their effective use.
Cheers,
Steve.
Hi Steve,
You may be in the wrong neck of the woods for that purpose. Although Perl has some
techniques for handling
Troy May wrote:
I have this line in one of my scripts:
if ( $pid = open( SWISH, '-|' ) )
Why am I opening -|? And what is it?
Well it is rope to hang yourself with ;-)... more required reading:
perldoc perlopentut
(Don't you just hate it when its in the manual?)
From the above:
The
'-' is usually STDIN or STDOUT... in the way you are using it, its
pipe in from STDIN
On Fri, 2003-02-14 at 14:48, Troy May wrote:
I have this line in one of my scripts:
if ( $pid = open( SWISH, '-|' ) )
Why am I opening -|? And what is it?
Thanks.
--
To unsubscribe, e-mail:
I'm trying to write a script that will open a socket connection to a
website and return a gif. I got it working to the point where and send
the request and receive the response, I was able to remove the HTTP
headers the only problem is that the GIF wont display properly. I
downloaded the gif via
hi all,
how fast are the perl executables when compared with perl scripts and
also when compared with C executable on linux ?
regards,
KM
---
On Thu, 13 Feb 2003, Gan Uesli Starling wrote:
From: [EMAIL PROTECTED]
Always group reply so that the rest of the list can help and be helped
by the discussion.
Patricia Hinman wrote:
I thought that this was the case. I downloaded a c
compiler called Miracle C. But I haven't learned how
it works yet. I do have C++ and 1000 page book to go
with it. (ugh)
The
If java style exceptions are what is needed, then try:
http://search.cpan.org/author/PJORDAN/Exception-1.4/Exception.pm
http://search.cpan.org/author/IX/libservlet-0.9.2/lib/Servlet/ServletException.pm
simran.
On Fri, 2003-02-14 at 14:56, R. Joseph Newton wrote:
Shaw, Steven wrote:
Hi,
depends on the task being performed and the level of optimisation
performed on the code.
On Fri, 2003-02-14 at 14:15, [EMAIL PROTECTED] wrote:
hi all,
how fast are the perl executables when compared with perl scripts and
also when compared with C executable on linux ?
regards,
KM
--- Wiggins d'Anconia [EMAIL PROTECTED] wrote:
Always group reply so that the rest of the list can
help and be helped by the discussion.
Sorry if I sent email to your address. It wasn't
intentional.
I'm new to encryption. When I think of Crypt I think
graveyard. And so far I've found no info
OOPS mistake corrected
I did stumble across a method call to a cryption()
---wrong crypt() is the method --
I have just discovered it is a unix function. It
doesn't decrypt. One must always crypt user input then
check for equality.
if (crypt ($guess, $pass) eq $pass) {
# guess
Hi - crypt () works fine for me on Win2K...
-Original Message-
From: Patricia Hinman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 6:57 PM
To: [EMAIL PROTECTED]
Subject: crypt() unix function, what about windows cryption? .htpasswd
file
OOPS mistake corrected
I
[stuff cut out]
I'd like it to be able to work on any number of files, and they might be
huge (20+ MB). I was thinking it'd be good to open up all the files at
once, and write out the new file one line at a time, but I can't figure
out how to set up an array of filehandles. I'm not sure if
R. Joseph Newton wrote:
Lance wrote:
If I hafta pass in refs from loop1 2 and 3 all the way down the line, So Be
It. It just makes my argument list a little unsightly, is all.
You might want to re-examine this view. The process of passing by reference
is not something to just resign
Shawn Bower wrote:
I'm trying to write a script that will open a socket connection to a
website and return a gif. I got it working to the point where and send
the request and receive the response, I was able to remove the HTTP
headers the only problem is that the GIF wont display properly.
I've been reading about htaccess files, directives,
pros and con's.
This redirects pages to another page in the .htaccess
file.
Redirect /location/from/root/file.ext
http://www.othersite.com/new/file/location.xyz
My question is do I need to use a Redirect to make the
browser go to my login
mario kulka wrote:
Hi,
I guess I'm lost again on this topic:(
I'm basically trying the following:
User logs in - then he has a choice:
1. enter new record
2. edit old one
Once taken to those new pages I somehow must keep the fact that he already
logged in and at the same time forbid other
Nancy Ford wrote:
I'm trying to run my first Perl script on a WinNT server. I get a logon box.
If I enter my username and password, it lets me in. If I cancel out or enter
the username and password of someone who is not in the Administrator's
group, I get the following error.
Is this CGI?
Nancy Ford wrote:
I'm trying to run my first Perl script on a WinNT server. I get a logon box.
If I enter my username and password, it lets me in. If I cancel out or enter
the username and password of someone who is not in the Administrator's
group, I get the following error.
HTTP Error
79 matches
Mail list logo