On Monday, April 22, 2002, at 10:46 , David Kirol wrote:
Thanks Drieux I didn't want to take the time to write what you did, but I'
m
glad to see it on the list.
David (aka sometimeAnotTooBrightNewbie)
Caveat Emptor - What Do I Know? All I know is what I have
figured out - and as I say, I
Drieux [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Besides I still feel squishy about the fact that
I can run perl modules as 644 - which just seems
unNatural to moi
The executeable bit is only necessary so your shell will use the first line
in the
[snip]
As far as the topic in the subject, it is not a perl issue. When
you want to
write in a file or execute a program, the permissions you choose have
nothing to do with the language you choose or if you are
executing code in a
CGI environment, so no, the topic is totally irrelevant to
--- Todd Wade [EMAIL PROTECTED] wrote:
...
anyone anything. My proof? perl.beginners and
perl.beginners.cgi is a place
where its pc to ask frequently asked questions. Over
and over.
Is there a FAQ document for this list? I just
re-read my list welcome message and didn't see any
reference
On Tuesday, April 23, 2002, at 05:44 , Todd Wade wrote:
Drieux [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Besides I still feel squishy about the fact that
I can run perl modules as 644 - which just seems
unNatural to moi
[..]
oh I 'get' the notions
Hi,
I am trying to use grep in a simple perl script to find all the lines in a
list (@labels) that contain certain names in a list (@names). The problem is
that grep finds all the lines in @labels for every name in the @names. here
is the script:
open(NAMES, names);
open(LABELS, labels);
inside grep $_ is a special var assigned to each value of the array.
use another var for the //;
-Original Message-
From: Nazary, David [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 12:29 PM
To: '[EMAIL PROTECTED]'
Subject: unexpected results with grep
Hi,
I am
instead of $_ I used $name but nothing was found by grep. What do you mean
by another variable?
-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 9:40 AM
To: 'Nazary, David'; '[EMAIL PROTECTED]'
Subject: RE: unexpected results with grep
(don't top-post; see responses in context below...)
-Original Message-
From: Nazary, David [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:12 PM
To: 'Nikola Janceski'; '[EMAIL PROTECTED]'
Subject: RE: unexpected results with grep
instead of $_ I used $name but
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:33 PM
To: 'Nazary, David'; '[EMAIL PROTECTED]'
Subject: RE: unexpected results with grep
... If you want to find the labels
containing the current name, you need something like:
I will not have any regep in the $names. It contains the name of users that
have created label type in ClearCase.
Thanks for your help
David
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 10:39 AM
To: 'Nazary, David'; '[EMAIL PROTECTED]'
Uncle Drieux Learns an important lesson.
Never let artists download and install interesting
perl CGI's to the site CGI without making sure that
they 'get it' about security.
I mean some ancient piece of cgi form got hacked today
and was spamming from our site - I mean they must have
gotten at
dave,
below is a snipet of the code. the most relavant part. when i enter some
bad data in or mysql has problems, it should go to error_handler() at the
bottom of my script. well it does, then it returns unless i put an exit at
the end of error_handler.
hi,
are there any perl modules that splits the http request headers into name/value pairs?
Conan
It Will Come To Us !!!
[EMAIL PROTECTED]
I don't use Perl for web stuff myself, but just from hearing other people
talk, you might want to look into the LWP modules and CGI.
-Original Message-
From: Conan Chai
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 4/23/02 9:07 PM
Subject: http headers
hi,
are there any perl modules
Hello everybody,
my code below should read in data from a file info.txt into a hash, the sub
print_hash should print all hash-elements. actually it only prints the last
key-value-pair. Does anybody see the mistake?Thank you for your help!!!
Greetings
Habi
use strict;
my
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Hi,
you should try this tiny (1,6 MB with manual and source code)
Perl IDE http://open-perl-ide.sourceforge.net/
(mirror at http://www.lost-sunglasses.de/).
It's not as comfortable as commercial app's, but It's
hi
im trying to sort out this sort routine:
the sub by_number_of_citations works
but if i try to make a sort alphabetically, my regex fails?
how should it be done?
martin
# sting to match: trtd1212/tdtdCited
Work/tdtd12/tdtd1232/tdtd1999/td/tr
# sort routine
#
sub
Hi guys
I was wondering if you could help me.
I have the following row of data in one file:
405^100^200^A^B C D E
I have the following fragment of code that reads the data row:
while (FILE_OPENED) {
$number_of_elements= 0;
chop;
($record, $customer,
405^100^200^A^B C D E
while (FILE_OPENED) {
$number_of_elements= 0;
chop;
($record, $customer, $location, $plan, @items) = split(/\^/, $_);
$number_of_elements= $#items + 1;
print number_of_elements: $number_of_elements\n;
}
At the
[EMAIL PROTECTED] wrote:
Hello everybody,
my code below should read in data from a file info.txt into a hash, the sub
print_hash should print all hash-elements. actually it only prints the last
key-value-pair. Does anybody see the mistake?Thank you for your help!!!
The scripts runs
Hello,
I've got two questions:
1. How could Perl help the PDA enthusiast?
2. When I turn on my PC, I'm promped to choose a OS: Win98 or WinXP. XP
doesn't work. So how to remove this prompt and run always Win98?
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
From: Kingsbury, Michael [EMAIL PROTECTED]
The question was never asked, but what type of performance difference
is seen with a perl2exe type compiler? I develope scripts for
Clearcase (a commercial CVS-type source revision control system) that
are run when a file is checked in/out etc, and
Another one to check out is OptiPerl by Xarka Software. It's not free, but
it is very inexpensive and does the things you mentioned. I've been using it
for about 6 months, and I can say the support for OptiPerl is very good. If
you have a question about its use, you just send them an email and
How to install Perl in HP-UX. I have download file perl-5.6.1-sd-10.20.depot.gz for
new system admin
please
Below is a subroutine that is part of a perl/Tk script. The variable
$test_path is initialized earlier to the empty string and the variable
$tests_directory is likewise initialized to the correct directory. The
array @test_files contains entries such as (test1, test2, ..) and is
correctly set by
Assuming all of your data follows the same format, you could always do
something like this:
$_ =~ /\^([^\^]+)$/; #a ^ followed by one or more non-^ chars
@items = split /\s/,$1;
Disclaimer: I might have the character class part wrong. I can't test this
yet.
or option 2:
($record,
On Mon, 2002-04-22 at 06:52, walter valenti wrote:
Hi,
there is in Perl a statement case like in C or in Pascal ???
Walter
Damian Conway has written a module to implement a switch for Perl as a
proof of concept for Perl 6. You can install it by saying
perl -MCPAN -e install Switch
Have you tried doing a print @test_files;? It looks to me like there
wouldn't be any files in the array because readdir(TESTS_DIR) would return
only the file names, not the full paths, so grep {-f $tests_directory/$_}
readdir TESTS_DIR; might not be returning anything. But then again I'm not
Timothy -
Yes, I have done a print @test_files and it is as expected.
Dick
Timothy Johnson wrote:
Have you tried doing a print @test_files;? It looks to me like there
wouldn't be any files in the array because readdir(TESTS_DIR) would return
only the file names, not the full
how are using this subroutine in your code?
Can you give us the line where you use this sub, Tk is bit picky at times
when you try funky things.
-Original Message-
From: richard noel fell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 10:45 AM
To: [EMAIL PROTECTED]
Need instruction not sure where to get it.
I have downloaded apache and perl. I just partitioned my hard drive with
partition magic, and now have 3 os systems on one computer. Win98, Win95,
and Linux. And want to install Win2000 soon.
What I want to know is do I have to put Active perl
On Tue, 2002-04-23 at 10:30, Chas Owens wrote:
On Mon, 2002-04-22 at 06:52, walter valenti wrote:
Hi,
there is in Perl a statement case like in C or in Pascal ???
Walter
Damian Conway has written a module to implement a switch for Perl as a
proof of concept for Perl 6. You
This works just fine for me. If you have use strict; in effect, you must
quote the following property names, ie:
'FitToPagesWide' = 1,
-
with ($Sheet-PageSetup,
FitToPagesWide = 1,
PrintGridlines = 0,
CenterHeader= Empty,
RightHeader = Test
Nikola -
Here is the code. I hope you can make some sense out of it. Thanks for
your efforts and help.
Dick
#!/usr/local/ActivePerl-5.6/bin/perl5.6.1 -w
use strict;
use File::Basename;
use Tk;
use Tk::Dialog;
use Cwd;
our $MW =MainWindow-new();
my $test_path=;
create_menu_bar();
Hi, i have this snippet (perl module) which uses Win32::registry(obsolete) but
it didn't worked very well,I wonder how to get his job with Win32::tieRegistry.
package NIC98;
require Win32::Registry;
sub GetNICName()
{
my $Register = System\\CurrentControlSet\\Services\\Class\\Net\\;
I can't make sense of the code. Sorry, but this is what I see looking back..
[map {[ 'command', $_,-command=sub{$test_path=$tests_directory./.$_;
print $test_path\n;}]}@test_files];
This line... you will understand if broken up by some white space
[
map {
[ 'command',
1. I dunno.
2. I suppose you could try either editing your boot.ini or replacing ntldr
and boot.ini with the correct versions of io.sys, msdos.sys, and
autoexec.bat and doing an MBR fix from fdisk or something crazy like that,
but either one is REALLY risky and may result in a non-bootable
On Monday, April 22, 2002, at 06:01 AM, [EMAIL PROTECTED] wrote:
hi
im trying to sort out this sort routine:
the sub by_number_of_citations works
but if i try to make a sort alphabetically, my regex fails?
how should it be done?
martin
# sting to match: trtd1212/tdtdCited
2. When I turn on my PC, I'm promped to choose a OS:
Win98 or WinXP. XP doesn't work. So how to remove
this prompt and run always Win98?
I suppose you could try either editing your boot.ini or
replacing ntldr and boot.ini with the correct versions
of io.sys, msdos.sys, and autoexec.bat
Change
($record, $customer, $location, $plan, @items) = split(/\^/, $_);
^^
To
($record, $customer, $location, $plan, @items) = split(/[\^\s]+/, $_);
Split buy default works on
Is there someway to get the line number of whence a subroutine was called?
i.e.
#!perl
use subs qw(die);
sub die {
## do some special stuff here.
CORE::die @_;
}
die not here if 0;
die I died here;
__END__
I want to see the line where die was called not line 6;
Is there someway to get the line number of
whence a subroutine was called?
Yes, but 9/10 ten people use Carp.pm, the
other 1 respondant was an assembly language
programmer.
perldoc Carp
Carp is implemented using 'caller', which
you can find documentation about at:
perldoc -f caller
If you
I am atheist so I don't believe in the Religion Module.
8^P
PS you're right... should have used Carp.
-Original Message-
From: Jonathan E. Paton [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:24 PM
To: [EMAIL PROTECTED]
Subject: Re: Line number of whence called
Is
np.. I forgot to CC the list those past few times.
-Original Message-
From: Nazary, David [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:34 PM
To: 'Nikola Janceski'
Subject: RE: unexpected results with grep
It worked just fine. Thanks very much for you help Nikola.
After die-ing, I think the Body::Decompose module still works fine without
any of the Religion subclasses. If you want to prevent this, you'll have to
put 'use Formaldehyde;' at the end of your code.
-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday,
I'm currently processing lines from an input file this way:
$_ = P=IcwRcsm D=D:SL=20 ST=d:\icw\rcsm\StartSv.bat
U=http://uslv...;
@Token = split ;
foreach (@Token)
{
$Proc = $' if (/P=/i) ;
$Start = $' if (/ST=/i) ;
Well, if you've already got a variable with the program name that you're
using, why not something like this:
$Start .= Parm1 Parm2;
(assuming that you are not using the variable $Start for anything else)
Otherwise you can do:
$newvar = $Start. Parm1 Parm2;
-Original Message-
From:
Nikola -
An interesting point. Perhaps you are onto something, but an eval where
you suggested does not work. However, you comments lead me to other
ideas to try.
Thanks,
Dick
Nikola Janceski wrote:
I can't make sense of the code. Sorry, but this is what I see looking back..
[map
I have been using the below subroutine for Parsing my data from forms. The
question I have; can someone explain this line to me,
$value =~ tr/+/ /;
The tr has me a bit confused.
Thank you for any input,
Ron
sub Parse_Form {
if
Just translates your + to .
my ($key);
$key = one two three+four;
$key =~ tr/+/ /;
print $key\n;
one two three four
-Original Message-
From: Ron [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 11:18 AM
To: [EMAIL PROTECTED]
Subject: RegEx question
I have been using the
From: Ron [EMAIL PROTECTED]
I have been using the below subroutine for Parsing my data from forms.
Please don't!
use CGI;
or
use CGI::Lite;
even
use CGI::Deurl;
but don't try it yourself.
The question I have; can someone explain this line to me, $value =~
tr/// translates from one character to another. So fo each + it finds
it translates it to a space. The purpose of tr/// is to be able to give
it one or more characters in the left part of the match and one or more
characters on the right side, and it will translate each char on the left to
the
On Tue, 23 Apr 2002, Ron wrote:
I have been using the below subroutine for Parsing my data from forms. The
question I have; can someone explain this line to me,
$value =~ tr/+/ /;
The tr has me a bit confused.
tr is transliterate, so it translates the first argument (+, in this case) to
Thank you. I feel like a dummy. Duh, tr = translate, I learned that in my
beginning PERL classes. Thank you folks for jogging my feeble mind.
Ron
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Kitti,
First you must unzip the file:
gzip -d perl-5.6.1-sd-10.20.depot.gz
Then you must install the file as root by running swinstall and pointing to the depot
file.
Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Roush Industries
Office: 734-466-6286
Cell: 734-231-6769
Fax:
On Apr 23, Ron said:
Thank you. I feel like a dummy. Duh, tr = translate, I learned that in my
beginning PERL classes. Thank you folks for jogging my feeble mind.
Actually, tr/// stands for transliterate, which means something
different. Translation is a context-related conversion of one
I have this problem now, maybe is not about perl but here I go:
I connected an Access Datasource to a cgi, (made in Perl ;), but while in
the command line runs perfectly, as a CGI, on my host, it outputs:
Software error:
No pude conectarme : (DBD: db_login/SQLConnect err=-1)
I know that maybe
On Tuesday, April 23, 2002, at 09:28 , Nazary, David wrote:
[..]
open(NAMES, names);
open(LABELS, labels);
@labels = LABELS;
@names = NAMES;
foreach $name (@names){
open(NEW, $name);#create a file with the name from @names
@labeled_names = grep (/$_/, @labels);
Actually, transliteration is the substitution of one character or set of
characters for another. Translation in the context below is the conversion
of words from one language to words of another. It is sometimes used as a
synonym for interpretation, but interpretation is the only definition
I have a variable that needs to store a string such as
$var = te$t;
This doesn't work since perl thinks the $ means I want some variable
substitution in there. I tried doing:
$var = te\$t;
but no luck there either.
What's the secret?
Thanks!
Matt
-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Matt Fuerst
Hmm. It should. If you do a print $var, it doesn't print correctly? Or
are you trying to do something else that fails? What is the error message?
-Original Message-
From: Matt Fuerst [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:06 PM
To: '[EMAIL PROTECTED]'
Subject:
Is there a simple way to evaluate multiple conditions in an if or
unless statement? For example take the following very simple example.
if (($something eq 'string0') || ($something eq 'string1') || ($something =~
/string2/)) {
do_something;
} else {
do_somthing_else;
}
Being a bit of a
How about this?
if($something =~ /^(string0|string1|string2)$/){
-Original Message-
From: Shaun Fryer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 1:15 PM
To: Perl Beginners
Subject: evaluating multiple conditions
Is there a simple way to evaluate multiple conditions in
* Matt Fuerst [EMAIL PROTECTED] [2002-04-23 22:06 +0200]:
$var = te$t;
I tried doing: $var = te\$t; but no luck there either.
te\$t should work. To avoid interpolation, you can also use single
quotes 'te$t' or q/te$t/ . man perlop for more information about quote
operators.
--
Johannes
* Shaun Fryer [EMAIL PROTECTED] [2002-04-23 22:15 +0200]:
Is there a simple way to evaluate multiple conditions in an if or
unless statement?
perldoc -q 'How do I create a switch or case statement?'
--
Johannes Franken
Professional unix/network development
mailto:[EMAIL PROTECTED]
Shaun,
You would want to use a switch (sometimes called case) statementtry
something like this
MYSWITCH: for ($something) {
/string0/ do {
do_something;
last MYSWITCH;
};
/string1/ do {
do_something;
But how do I know who the correct user is???
I have tried todos (all) the admin
but it doesnot work!
-Mensaje original-
De: David Kirol [mailto:[EMAIL PROTECTED]]
Enviado el: Martes, 23 de Abril de 2002 02:45 p.m.
Para: Eduardo Cancino
Asunto: RE: [OT] DBI-ODBC WIN2K
Eduardo,
here is the source of my cgi
use DBI;
use CGI qw(:standard);
use CGI::Carp ('fatalsToBrowser');
my $dbh = DBI-connect ( dbi:ODBC:database, admin, all ) or die No
pude conectarme : $DBI::errstr\n;
my $sth = $dbh-prepare( SELECT titulo, id, fecha FROM table1 ORDER BY id
-Original Message-
From: Shaun Fryer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 4:15 PM
To: Perl Beginners
Subject: evaluating multiple conditions
Is there a simple way to evaluate multiple conditions in an if or
unless statement? For example take the following
Basically, I have 30 records in one file and another file with 25 records...
these files are opened for reading, a record from the first file is paired
with a record from the second file and output a 3rd file. Obviously, the
first 25 records are fine, but the last five records are being paired
Oops. I misread the last operator. I should have written
if($something =~ /^(string0|string1)$/ || $something =~ /string2/){
I don't know how efficient it would be, I haven't benchmarked it.
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23,
-Original Message-
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 5:11 PM
To: 'Bob Showalter'; 'Shaun Fryer'; Perl Beginners
Subject: RE: evaluating multiple conditions
Oops. I misread the last operator. I should have written
if($something
Rich Busse wrote:
I'm currently processing lines from an input file this way:
$_ = P=IcwRcsm D=D:SL=20 ST=d:\icw\rcsm\StartSv.bat
U=http://uslv...;
@Token = split ;
foreach (@Token)
{
$Proc = $' if (/P=/i) ;
$Start =
Well, we've been through this before, but if you're really worried about
having a \n at the end of your string, you can substitute a \Z for the $
in the regex. It all depends on where the input comes from, and besides,
noone has been able to give an example of how this can come back to bite you
Is there a better way to simplify the syntax when testing for multiple
conditions?
Your original code is the proper way to do it. All the other solutions
proffered are inferior, IMO.
Use 'or' and 'and' to remove clutter, they have different precedance and
are often useful in this
On Tue, 2002-04-23 at 17:00, Ron Powell wrote:
Basically, I have 30 records in one file and another file with 25 records...
these files are opened for reading, a record from the first file is paired
with a record from the second file and output a 3rd file. Obviously, the
first 25 records
On Tuesday, April 23, 2002, at 03:05 PM, Jonathan E. Paton wrote:
Is there a better way to simplify the syntax when testing for multiple
conditions?
Your original code is the proper way to do it. All the other solutions
proffered are inferior, IMO.
Use 'or' and 'and' to remove clutter,
This code doesn't need to be fixed. For style, I would remove the
inner parens (unnecessary) and change the function calls to
do_something() instead of the (old-style) do_something.
Is changing the function calls just a matter of style, or is
there a more important reason to do it?
Is there a simple way to comment multiple lines in Perl in a like
manner to the /* or !-- comments in JavaScript and HTML
respectively. Or is it absolutely necessary to put a # at the
beginning of each individual commented line?
===
Shaun Fryer
===
London
=cut
multi
line
comment
=cut
__DATA__
Mike
-Original Message-
From: Shaun Fryer
Sent: Tue 4/23/2002 6:37 PM
To: Perl Beginners
Cc:
Subject: commenting perl
Is there a simple way to
I have been using the below subroutine for Parsing my data from forms.
Up until recently I was using cgi-lib.pl's ReadParse routine to do the
same thing. Since the one you are using is quite similar you can
easily port existing scripts using the following in place of that
subroutine.
use CGI;
It's my understanding that the difference between
some_func;
and
some_func();
is that the '' invocation passes the original contents of @_ into
some_func, whereas the '()' invocation has an empty @_ in some_func. In the
first instance, some_func has access to the arguments of the
Hi, Shaun, :)
From my reading of the 'perlsub' manpage, the
some_func( arg1, arg2, ..., argn );
syntax calls some_func with the specific argument list but does *not* check
some_func's prototype (if it has one). So, it's a way of getting around
overly-fascist functions if you need to.
I
Say, can anyone help me get perl 5.6.1 installed under AIX 4.1.5?
I have tried and tried, and here's what I keep getting during make, I
think...
gcc -o miniperl -L/usr/local/lib `echo gv.o toke.o perly.o
op.o regcomp.o dump.o util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o
scope.o
This is making my head hurt. In an effort to share my pain, I humbly ask
the list for help.
(part of) My code looks like this:
chdir 'j:/wsinfo';
system dir /p;
When I execute it from command line, I get a directory of j:\wsinfo -
exactly what I wanted.
When I execute it from a web browser,
hi,
are there any perl modules that splits the http request headers into name/value pairs?
Conan
It Will Come To Us !!!
[EMAIL PROTECTED]
I don't use Perl for web stuff myself, but just from hearing other people
talk, you might want to look into the LWP modules and CGI.
-Original Message-
From: Conan Chai
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: 4/23/02 9:07 PM
Subject: http headers
hi,
are there any perl modules
The suggestion of:
if($something =~ /^(string0|string1|string2)$/)
is not equivalent to your original condition. It's also likely to be
inefficient.
I get 1 min 15.983sec for normal three condition if, and 52.305sse for
a regex approach. My
test code is:
my $type =
Hi,
Is there anybody who installs ActivePerl5.6.1 successfully on window XP home
edition? I used to use MacPerl, but now I had a new PC. I tried
several times following the instruction from Activestate company, not
working. I also try to install standard perl distribution, but I don't know
90 matches
Mail list logo