- Original Message -
From: [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Saturday, September 03, 2005 12:20 AM
Subject: syntax Error ..
Hi Guys...
Can u plz give me the write syntax for
this
foreach (@lookup_datatype){
my $plus;
($plus) = /([0-9]+)/;
print
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Sent: Friday, August 26, 2005 10:37 PM
Subject: Re: Need an explanation
maybe this is brief:
while () {
chomp;
next if /^#/;
next if /^$/;
my
- Original Message -
From: Tom Allison [EMAIL PROTECTED]
To: beginners perl beginners@perl.org
Sent: Friday, August 26, 2005 4:49 PM
Subject: map/grep and arrays
I keep getting hung up on what I think would be a simple problem.
I was to do approximately this:
Given an array of
Hi:
Try this:
variable_to_store = `rsh -l username hostname 'command arg1 arg2 ..`;
This works for me, I don't know if this is the best way or if it the more
secure way to run a command in a remore machine, try to search CPAN for a
module that can do something similar.
Pablo.
On 8/24/05,
Hello,
I got the following function online but and receiving the error and
do not know why ?
Use of uninitialized value in string at ./sat-main.pl line 211, STDIN
line 1
Here is the code:
my $input;
$input = user_func(Enter command );
sub user_func {
my $user_input;
Hi:
In the following perl script, I would like to print all the lines in a
file
(mdout_short.txt) to temp.txt which have NSTEP as a word:
use strict;
use warnings;
my $mdout_file = mdout_short.txt;
my $mdout_xtemp_file = temp.txt;
I have a series of EZMLM configuration files in the ~alias directory that
look like this:
main:/var/qmail/alias# cat cire/config
F:-aBCdEFGHiJKlmnOpQrStuVWXYZ
X:
D:/var/qmail/alias/cire
T:/var/qmail/alias/.qmail-cire
L:cire
H:infoforhealthx.org
snip
/snip
main:/var/qmail/alias#
I want to find
- Original Message -
From: KEVIN ZEMBOWER [EMAIL PROTECTED]
To: beginners@perl.org
Sent: Thursday, August 18, 2005 1:06 AM
Subject: Finding matches and use of __END__ in a one-liner
I have a series of EZMLM configuration files in the ~alias directory that
look like this:
I have just successfully figured out how to get the return from a
package
in the main program..
@Data = ReadFile::ReadFile(TownCrier.db);
Wha Hoo
ANYONE having more informtion on making and using packages, please let me
know.
My 6 book library barely mentions it!
my
Hi all,
I have a text file with columns, where the columns may not be aligned,
and not all lines may have data in all columns:
header1 header2 header3header4
l1dat1l1dat2l1dat3 l1dat4
l2dat1
On Aug 12, Randy Macdonald said:
However, when I run:
print 'a';
use NotARealPackage;
print 'b';
I expect to get:
a
but I get no output at all. Why is this?
The 'use' statement is special to Perl. It is executed at compile-time,
not at run-time like most of the rest of
According to the tutorial I'm following:
{n}matches exactly n of the previous thing
Thus I expect:
fo =~ /o{2}/ = false
foo =~ /o{2}/ = true
fooo =~ /o{2}/ = false
Instead I get:
fo =~ /o{2}/ = false
foo =~ /o{2}/ = true
Hi all,
In the usual case when we code something like
code
open(TO_PIPE,| sendmail blah blah) or die($! : fork failed) ;
##do something here
close(TO_PIPE) or die($! : bad sendmail) ;
/code
What does perl do when it encounters the open() and the close() statements??
Especially, why can an error
Yes. As your requirements stated are not very specific, I'd recommend you to
see the entries for
$/ (in perldco perlvar)
/s modifier for s/// operator.
|-Original Message-
|From: Cy Kurtz [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, June 07, 2005 6:21 PM
|To: beginners@perl.org
|Subject:
|-Original Message-
|From: lance w [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, May 31, 2005 6:42 PM
|To: beginners@perl.org
|Subject: simple open file
|
|
|Hello,
|I'm trying to open (create if necessary) a file for APPEND, that will
|serve as a log. The script I'm using will open a file,
See
perldoc -f glob
and the angle bracket operator in
perldoc perlop
@files = glob(*.v) ;
#or
@files = *.v ;
|-Original Message-
|From: Eliyah [mailto:[EMAIL PROTECTED]
|Sent: Thursday, May 26, 2005 3:10 PM
|To: beginners@perl.org
|Subject: search a file
|
|
|Hello, I'm writing a
you forgot to chomp both your currency holders. Both contain a newline at
the end, but the second one _appears_ ok to your eyes coz its the end of the
line. You should chomp both (as shown below), and then format your output
with any newlines if necessary...
|-Original Message-
|From:
|-Original Message-
|From: Gayatri [mailto:[EMAIL PROTECTED]
|Sent: Monday, May 16, 2005 10:40 AM
|To: beginners@perl.org
|Subject: Threads related document to refer in perl
|
|
|Hello Friends,
|
|
|
|I want to create threads using perl.
|
|So if any documents or links are there to
|-Original Message-
|From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
|Sent: Thursday, May 12, 2005 3:01 AM
|To: beginners@perl.org
|Subject: calling a separate perl script from within another perl script
|
|
|All,
|
|I have done some reading and know there are various way to do this,
|-Original Message-
|From: John Doe [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, May 03, 2005 1:50 AM
|To: beginners@perl.org
|Subject: Re: Translate standard date/time format to EPOCH seconds
|
|
|Am Montag, 2. Mai 2005 19.52 schrieb Charles K. Clarkson:
| [EMAIL PROTECTED] mailto:[EMAIL
perl -i -pe 's/offending_code//g' /path/to/*.html
|-Original Message-
|From: Orel Stringa [mailto:[EMAIL PROTECTED]
|Sent: Friday, April 29, 2005 5:21 PM
|To: beginners@perl.org
|Subject: How can I automate the removal of hard-coded banners from
|locallysaved web pages
|
|
|Hi,
|
|I
|-Original Message-
|From: Ing. Branislav Gerzo [mailto:[EMAIL PROTECTED]
|Sent: Friday, April 29, 2005 7:11 PM
|To: beginners@perl.org
|Subject: Re: REGEXP removing - il- - -b-f and - il- - - - f
|
|
|[EMAIL PROTECTED] [D], on Friday, April 29, 2005 at 09:30 (-0400)
|wrote about:
|
Additionally, the import method defined in a package(or inhertied by it) is
not called when you 'require' a module. So, even @EXPORT symbols in the
'require'd module (which are by default imported in the current namespace
when you 'use' it) are not imported.
See perldoc perlmod for more on this.
perldoc perlmod also goes to say
quote
An exception would be if two modules each tried to use each other, and
each also called a function from that other module. In that case, it's easy
to use requires instead.
/quote
anyone knows how/why require is useful in this case ??
|-Original
|-Original Message-
|From: lio lop [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, April 19, 2005 5:44 PM
|To: beginners@perl.org
|Subject: Match a pattern
|
|
|I need to print the text between two words
| that are in different
|lines.
|
Assuming you want to get
|-Original Message-
|From: Brett Williams [mailto:[EMAIL PROTECTED]
|Sent: Saturday, March 26, 2005 3:01 PM
|To: beginners@perl.org
|Subject: re: very new - need help with regular expressions
|
|
|Thank you Manav :)
|
|That was a big help. I now have another problem however. I had
-Original Message-
From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 16, 2005 12:06 AM
To: Perl Beginners List
Cc: Anish Kumar K.
Subject: Re: System o/p to a varaible
On Mar 15, Chris Devers said:
system($command)
or die Couldn't run command
See
perldoc -f length
Manav
-Original Message-
From: Bastian Angerstein [mailto:[EMAIL PROTECTED]
Sent: Friday, March 11, 2005 1:36 PM
To: beginners@perl.org
Subject: How to figure out Size of Var.
How can I figure out how many chars are stored in a variable?
Or how can I determit
;)
$a is an anonymous reference to the array defined
@$a resolves that reference
[EMAIL PROTECTED] prints out the index of the last element of array
$a-[elemmentnumber] is used to access an element thru an array reference.
so
$a-[EMAIL PROTECTED] simply gives you the last element of the array
chomp($date=`date`) ; ##exploiting what Perl offers but C doesnt
-Original Message-
From: Ankur Gupta [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08, 2005 10:03 PM
To: [EMAIL PROTECTED]
Cc: beginners@perl.org
Subject: Re: output from system call
[EMAIL PROTECTED] wrote:
Hi,
Is
use strict;
use warnings;
use Data::Dumper ;
my %kw = ();
my $kw = \%kw;
my $i = 1;
for my $cat (split(/\//, 'something/other/foo/bar'))
{
$kw-{cat.eval{$i++}} = $cat
}
print Dumper \%kw ;
-Original Message-
From: Ing. Branislav Gerzo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 08,
This??
perl -i.bak -ne 'print =$.= $_' /path/to/code_file
Manav
-Original Message-
From: Gavin Henry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 5:44 PM
To: beginners@perl.org
Subject: Re: code on stonehenge.com for adding line numbers to code
quote who=lohit
is this
Also,
there should be a space between #!/usr/bin/perl and the -w switch.
Manav
-Original Message-
From: bright true [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 01, 2005 10:51 PM
To: Earthlink-m_ryan
Cc: beginners@perl.org
Subject: Re: accidently changed stdout | can't print to screen
use strict ;
use warnings ;
use File::find ;
my %hash ;
my %by_value ;
find(sub{$hash{$_}=(stat $_)[9]},'/path/to/Udb/Backups') ;
while (($key, $value) = each %hash) {
push @{$by_value{$value}}, $key;
}
my @[EMAIL PROTECTED] {$a = $b} keys %by_value ;
local $=\n ;
print @array[0..2] ;
Try this
my $countdown = 5;
local $|=1 ;
while ($countdown 0){
print \.;
sleep 1;
$countdown--;
}
print Kaboom!!
-Original Message-
From: Mark Jayson Alvarez [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 9:39 AM
To: beginners@perl.org
Subject: Perl waits for while to finish
Are you using it as a command line tool or as CGI etc??
Manav
-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 1:12 PM
To: beginners@perl.org
Cc: 'Manav Mathur'; 'Mark Jayson Alvarez'
Subject: RE: Perl waits for while to finish before printing
The same code works here on ActivePerl. As far as I know, some web-servers
do default buffering...thats why I asked if you were using it as CGI
Manav
-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED]
Sent: Monday, February 21, 2005 1:21 PM
To: 'Manav Mathur'; beginners
shift accepts only one argument, the array. and shifts of an element from
the beginning of the array.
-Original Message-
From: bright true [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 10, 2005 6:43 PM
To: Boysenberry Payne
Cc: beginners@perl.org
Subject: Re: Changing the path in
my @files=path/to/list_of_files ; ##should be good enough
-Original Message-
From: Ing. Branislav Gerzo [mailto:[EMAIL PROTECTED]
Sent: Friday, February 04, 2005 1:57 PM
To: beginners@perl.org
Subject: Re: Deleting selected files in a directory through perl
Kamalraj Singh Madhan,
httpd.conf
==
- Hope you Servername dorective is already correct
- Add(or uncomment)
ScriptAlias /cgi-bin/ /path/to/Apache/cgi-bin/
- Add(or uncomment)
Directory /path/to/Apache/cgi-bin
AllowOverride None
Options ExecCGI
/Directory
-Original Message-
From: vishwas
That is because you are *not* printing Browser Test to the OUTFILE handle.
open(OUTFILE, survey.txt);
print OUTFILE this is a test!!!\n;
print OUTFILE htmlBrowser test/html\n;
close(OUTFILE);
-Original Message-
From: Elliot Holden [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 03,
you can use the perl debugger for that.
see
perldoc perldebug
-Original Message-
From: Gavin Henry [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 02, 2005 5:36 PM
To: beginners@perl.org
Subject: Subroutine for a scripts progress
Dear all,
I haven't coded anything yet, but I
use CGI::Carp qw(fatalsToBrowser) ;
will redirect the error messages to the browser(if you are not checking the
webserver logs, please do so immediately).
Manav
-Original Message-
From: Anish Kumar K. [mailto:[EMAIL PROTECTED]
Sent: Monday, January 31, 2005 7:41 PM
To: beginners perl
Rob, In your solution
$hash{'pqr'} will return 3.
- iniitalize $i with 1
or
-
%hash=map{$_=[EMAIL PROTECTED];
Manav
|-Original Message-
|From: Rob Napier [mailto:[EMAIL PROTECTED]
|Sent: Thursday, January 27, 2005 2:06 PM
|To: Richard Chycoski
|Cc: Mallik; Perl-Trolls;
my($val)=$history[0]-{'input_contents'} =~ m/\$id\s*=\s*\'([^']*)\'\;/ ;
print $val ;
Manav
|-Original Message-
|From: Jerry Preston [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, January 26, 2005 5:58 PM
|To: 'Perl Beginners'
|Subject: How to read this array?
|
|
|I have this array and I
Im facing the same issue. again from India. yesterday didnt go on the site
but today, there's a definite problem
Manav
|-Original Message-
|From: Harsh Busa [mailto:[EMAIL PROTECTED]
|Sent: Thursday, January 20, 2005 11:18 PM
|To: beginners@perl.org
|Subject: cpan slow ?
|
|
|hi
|
|i m
]
different for dfferent entries. Thats why I have introduced an additional
s/^\s*//; to get rid of the spaces
|-Original Message-
|From: Manav Mathur [mailto:[EMAIL PROTECTED]
|Sent: Wednesday, January 19, 2005 1:29 PM
|To: Manav Mathur; Chris Knipe; beginners@perl.org
|Subject: RE: regex needed
Still cant get to you chris
-Original Message-
From: Manav Mathur [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 19, 2005 9:44 PM
To: Chris Knipe
Subject: RE: regex needed
Sure thing. I have put my updated scripts in perl.org. As I love making
mistakes :( , you must refer
Chris , cant get to you.
1) Use $RouteArray[2] instead of $RouteArray['2']
2) POst me the 11th route entry
|-Original Message-
|From: Chris Knipe [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, January 18, 2005 7:55 PM
|To: beginners@perl.org
|Subject: Re: regex needed
|
|
|Hi Randy,
|
|Ok
;
my @RouteArray = split(/ +/,$_,8);
if (($RouteArray[2] =~ /^\s*S$/) and ($RouteArray[5] =~
m/^165\.(165|146)/) and ($RouteArray[7] =~ m/National\s*Gateway/i)) {
$Terminal-cmd(ip route remove . $RouteArray[1]);
}
}
|-Original Message-
|From: Manav Mathur
Which webserver are you using? Is /cgi-perl/ directory enabled for executing
scripts??
For Apache, you might be interested in the Scriptalias directive.
Manav
|-Original Message-
|From: Graeme McLaren [mailto:[EMAIL PROTECTED]
|Sent: Tuesday, January 11, 2005 6:14 PM
|To:
Are you sure you want to do this. The type of page you are developing has
been long been a security headache. Imagine the user entering
/bin/date -s 20050427; cat /etc/passwd | mail -s 'there you are'
I understand that you are trying to implement remote root tasks through CGI,
but you must
52 matches
Mail list logo