Thank you all for your comments!
Because I am used to C/C++ I do not 'like' the usage of variables and
subroutines before even declaration in a source code 'instinctively'.
This is, of course, my personal spleen which may change with more
experience in using Perl.
brian d foy wrote:
perl
How would I print only the words that contain the letter p in a file???
Right now I am only printing the entire lines that contain words with the
letter p.
while (FILE)
{
if(/[p]/)
{
print $_;
--- David Draley [EMAIL PROTECTED] wrote:
How would I print only the words that contain the letter p in a file???
Right now I am only printing the entire lines that contain words with the
letter p.
while (FILE)
{
if(/[p]/)
{
- Original Message -
From: David Draley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 24, 2001 8:13 AM
Subject: reg exp match
How would I print only the words that contain the letter p in a file???
Right now I am only printing the entire lines that contain words with
How do you check for the null set or blank with checkboxes using
CGI.pm? The following code does not work for checkboxes though it
does for all other input fields.
#TEST FOR BAD CHARS
my ($name, $value);
foreach $name ($q-param())
{foreach $value ($q-param( $name ))
{#CK FOR BLANKS
if
I have a data structure similar to the following:
@hosts = ( list of hashes like below ... );
%hosts = ( name = hostname,
ipaddr = www.xxx.yyy.zzz,
location = location
);
How can produce a sorted list of the hashes based on the hostname and then
access each
I want to take a win32 perl script to unix. Is their any document telling that what
are the problems we are going to face, when we take the script to unix domain.
Thanks
jude
Things you need to look out for are file locations, adding the shebang to
the top of the script (the #!/path/to/perl), directory paths that are
specified as \\ instead of / and any Win32 specific modules. Other than
that, test the script and see if it breaks...
HTH
John
-Original
Hi,
I've got a number of elements that are specified in a hash.
I need to find out the number of elements in the hash.
Is there any quick way, like $#array for arrays.
I can always move through the keys and increment a counter, but I'm
looking for a shortcut.
thanks.
George P.
$hash_length = scalar keys %hash;
John
-Original Message-
From: George S Pereira [mailto:[EMAIL PROTECTED]]
Sent: 24 September 2001 10:26
To: [EMAIL PROTECTED]
Subject: How many elements are there in a hash?
Hi,
I've got a number of elements that are specified in a hash.
I need to
Hi.
I would like to use a global variable in my perl application, but since
everything in perl is in a package, it will always belong to some
package. what can I do?
thanks,
ruthie
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi!
Perl 5.6 provides the 'our' statement as opposite to 'my': it makes a
variable global to a file in which it's used.
HTH
Sascha
- Original Message -
From: Ruth Albocher [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 24, 2001 1:01 PM
Subject: global variables
Hi.
Teresa,
I'd have to highly recommend Writing CGI Applications with Perl. Myself
and Kevin Meltzer wrote it, so we may be a bit biased towards it though
But, it has received great reviews from several people.
:o)
Brent
While I really like using UNIX Shells by Example, PERL by Example has
been a bit of a disappointment. The organization could be a bit better
and some of the examples haven't worked well for me. I use Programming
PERL by O'Reilly almost exclusively.
John
Teresa Raymond wrote:
Has anyone
i have to honestly say, i didnt read the entire problem, but i see a line in
your code which you probably don't want:
while (FILE) {
my @line = split /\|/, FILE;
the while thing puts the line in $_
you are then discarding that line, and reading hte *next* line in that file
and feeding that to
Hi!
I have a file with a line that is .
I would like to create a file with all the lines after the line
___.
I don't know how to do that
Thanks
Franck
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For Windows NT, try
system (start $command);
For a load of options, enter start /? at the Windows NT command line.
-Original Message-
From: Najamuddin, Junaid [mailto:[EMAIL PROTECTED]]
Sent: Friday, 21 September, 2001 14:56
To: 'Sidharth Malhotra'; Jonathan Howe; [EMAIL PROTECTED]
I may be looking at this wrong, but it seems as though the preposed solution
would work. Since the incrementing is done outside the brackets of the if
statement, the index is incremented for each element regardless of the
outcome of the if statement.
Joyce
- Original Message -
From:
Hi!
I have a file with a line that is .
I would like to create a file with all the lines after the line
___.
I don't know how to do that
Thanks
Franck
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi, I would delete a file if it is already present.
for exemple I have:
1001337334: dhcpd : DHCPDISCOVER from 00:b0:d0:23:80:67 via eth0
1001337334: dhcpd : Reclaiming abandoned IP address 192.40.54.41.
1001337334: dhcpd : (DHCPDISCOVER) (ack_lease) CLASS_IDENTIFIER = PXEClient
1001337334:
How do I insert $scalar into position $x of @array, where $x is smaller than
$#array?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Folks,
need a little assistance here, I finally have stumbled upon the need to make
an interactive perl
script. One that takes answers from stdin etc... I have written a few perl
scripts that are not interactive, but never interactive.
Could someone point me to some examples? please, dont send
perldoc -f splice
@array = (1, 2, 3, 4, 5);
splice(@array, 3, 1, 10);
print @array;
1, 2, 3, 10, 5
Cheers,
Kevin
On Mon, Sep 24, 2001 at 03:08:09PM +0200, Pete Sergeant ([EMAIL PROTECTED]) said
something similar to:
How do I insert $scalar into position $x of @array, where $x is smaller
$array[$x]=$scalar;
How do I insert $scalar into position $x of @array, where $x is smaller than
$#array?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Do You Yahoo!?
Get your
Pete Sergeant wrote:
How do I insert $scalar into position $x of @array, where $x is smaller than
$#array?
E.g.:
@primes = (1, 2, 3, 5, 11, 13); # oh, I forgot one
@primes = (@primes[0..3], 7, @primes[4..$#primes]);
Greetings,
Andrea
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Folks,
I have the following little test code
my $output = EOF
Select the number of clients to run for this SLT:
1) 2000
2) 1500
3) 1300
4) 500
=
EOF
;
print $output;
$num_clients = STDIN;
how would I get the cursor to be on the same line as
Any ideas on how to set the TCP options on socket connections? setsockopts
seems only to deal with the socket layer.
-mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
=
EOF
;
print $output;
Instead of including your put text here arrow in
your initial block, put it as part of output:
my $output = EOF
Select the number of clients to run for this SLT:
1) 2000
2) 1500
3) 1300
4) 500
EOF
;
print $output =;
Option #1 )
my $output = EOF
Select the number of clients to run for this SLT:
1) 2000
2) 1500
3) 1300
4) 500
=
EOF
;
chomp $output;
print $output;
$num_clients = STDIN;
Option 2 )
print qq[
Select the number of
There's a packege Net::RawIP, to built packets TCP, UDP, ICMP, and capture
packets (is a wrapper for libpcap).
Work only on *nix system.
Walter
Any ideas on how to set the TCP options on socket connections? setsockopts
seems only to deal with the socket layer.
-mike
--
To
In article
[EMAIL PROTECTED],
[EMAIL PROTECTED] (George S Pereira) wrote:
I need to find out the number of elements in the hash.
Is there any quick way, like $#array for arrays.
the keys() function, in scalar context, returns the number
of pairs in the hash.
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Walter
Valenti) wrote:
[original citation missing]
How do I insert $scalar into position $x of @array, where $x is smaller than
$#array?
$array[$x]=$scalar;
this replaces whatever was at index $x. to insert something
you need to use
In article
[EMAIL PROTECTED]
m, [EMAIL PROTECTED] (Ronald Yacketta) wrote:
Could someone point me to some examples? please, dont send the usual perldoc
-f blah.. the company I am doing these scripts for does not have the perldoc
installed
there is always a way to get the perl
Hi ALL, I get pretty much all the time this error
message when I try to connect to a remote MS SQL
Server 2000 database.
Anyone knows why this is happening and how to overcome
it?
Code looks like this
#!/usr/bin/perl
use DBI;
my $dbh = DBI-connect
(dbi:Sybase:mssql, 'test', 'test');
die Unable
True..
but tis hard to view that page when the company has it filtered out via its
proxy... why? only the twits who run the proxy know
-Original Message-
From: _brian_d_foy [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 12:12
To: [EMAIL PROTECTED]
Subject: Re: going
In article
[EMAIL PROTECTED]
m, [EMAIL PROTECTED] (Ronald Yacketta) wrote:
my $output = EOF
Select the number of clients to run for this SLT:
1) 2000
2) 1500
3) 1300
4) 500
=
EOF
;
print $output;
$num_clients = STDIN;
how would
In article 2FB59B145095D511A7C90050BAC349F312DB@MAIL,
[EMAIL PROTECTED] (John Edwards) wrote:
$hash_length = scalar keys %hash;
that's already in scalar context since you are assigning
to a scalar. :)
--
brian d foy [EMAIL PROTECTED] - Perl services for hire
CGI Meta FAQ -
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
(Ruth Albocher) wrote:
I would like to use a global variable in my perl application, but since
everything in perl is in a package, it will always belong to some
package. what can I do?
stay away from global variables. :)
what are you trying
In article 001201c144fb$4a1ba3d0$ec00a8c0@boxx, [EMAIL PROTECTED]
(Sascha Kersken) wrote:
Perl 5.6 provides the 'our' statement as opposite to 'my': it makes a
variable global to a file in which it's used.
it declares a package variable, actually. if you aren't in its
package, then you have
Folks
I need to know how can get to convert a hexadecimal string to text,
there are some function or something, thanks!!
sorry by my english
hernan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
You have various problems with your code, one of which was already mentioned
by Jos. I will mention it again, as well as point out the other problems.
On Sat, Sep 22, 2001 at 06:22:01PM +0200, Birgit Kellner wrote:
use strict;
my (@hits, $key);
my %hash = ('0' = 'miller', '1' = '32', '2' =
On Mon, Sep 24, 2001 at 03:24:26PM +0200, Jorge Goncalvez wrote:
I would to delete the first 1001337334: dhcpd : DHCPOFFER on 192.40.54.41
to 00:b0:d0:23:80:67 via eth0 because it is repeated.
perldoc -q 'line in a file' or
http://www.perldoc.com/perl5.6.1/pod/perlfaq5.html second question.
I'd have to highly recommend Writing CGI Applications with Perl
Could not agree more, the best intermediate Perl book around.
(Is it meant to be intermediate Mr Author?)
line by line code explaination, and useful programs too.
The best absolute beginners book is Elements of programming Perl by
Jonathan Batchelor writes:
I have a data structure similar to the following:
@hosts = ( list of hashes like below ... );
%hosts = ( name = hostname,
ipaddr = www.xxx.yyy.zzz,
location = location
);
How can produce a sorted list of the hashes based on the
On Mon, Sep 24, 2001 at 11:20:10AM -0400, Kingsbury, Michael wrote:
Any ideas on how to set the TCP options on socket connections?
setsockopts seems only to deal with the socket layer.
Generally, the Perl interface to TCP/IP is equivalent to the C interface.
What would be the equivalent code
If you mean that you have a string containing 61626364 and you want
abcd:
print pack a*, 61626364;
On Mon, 24 Sep 2001, Hernan wrote:
Date: Mon, 24 Sep 2001 13:50:52 -0400
From: Hernan [EMAIL PROTECTED]
To: [EMAIL PROTECTED] [EMAIL PROTECTED]
Subject: convert hexa to text
Folks
I need
On Sat, Sep 22, 2001 at 05:06:46PM -0400, Kevin der Kinderen wrote:
My method for downloading and installing might be a bit unconventional.
I use 'perl -MCPAN -eshell' and the 'r' command to find updated modules.
I then get the modules and install them manually. I've had problems in
the
Folks,
What would be the most efficient,easiest way to nohup a script from within
perl?
$file_to_run = nohup $filename ;
exec ($filename); ?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Sep 24, Pete Sergeant said:
@hosts = sort { %{$a}-{'name'} = %{$b}-{'name'} } @hosts;
That (%{$x}-{key}) works for an ugly reason. It's probably a bug.
@hosts = sort { $a-{name} cmp $b-{name} } @hosts;
--
Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI
-Original Message-
From: Yacketta, Ronald [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 10:17 AM
To: Beginners (E-mail)
Subject: going down an uncharted path
...please, dont send the usual perldoc-f blah.. the
company I am doing these scripts for does not
have the
Hi there,
I'm wondering if there are any certification tests for
Perl. I would just like to be able to put something on
applications and resumes to let employers know I can
do some Perl.
Any ideas?
Thanks!
-Patrick Hall
[EMAIL PROTECTED]
Dear all,
This is my first post, so hello to everyone. Now time for my first ever
question, which is a bit of a philisophical one.
I have just started learning Perl in the last couple of weeks and have just
finished my first bespoke program.
It's quite involved (for me) and I have been having
I am not a Perl programmer but I need help - does anyone do Unix Perl
scripting that can assist me?
I am sure it's pretty basic coding ... I need to parse out the /etc/group
file to list all users and the groups they are in.
thanks,
JMRiggs
On Mon, Sep 24, 2001 at 06:14:36PM +0100, John Moylan ([EMAIL PROTECTED]) said
something similar to:
I'd have to highly recommend Writing CGI Applications with Perl
Could not agree more, the best intermediate Perl book around.
I love reading that!
(Is it meant to be intermediate Mr
Hi Claement,
If you wish, you can post your code on the web somewhere and I am sure folks
would be happy to review it and give some commentary on it. If you can not put
it on the web (for whatever reason), please ask people to email you directly to
get a copy (i.e. don't send it to the list :)
On 9/24/2001 3:51 PM, patrick hall [EMAIL PROTECTED] wrote:
applications and resumes to let employers know I can
do some Perl.
Any ideas?
Write your resume in Perl; I did. And, if you don't believe it works in
getting more interviews - it got me the job I have now :)
Best;
-Sx-
On 9/24/2001 4:00 PM, Riggs, Joan [EMAIL PROTECTED] wrote:
I am not a Perl programmer but I need help - does anyone do Unix Perl
scripting that can assist me?
I am sure it's pretty basic coding ... I need to parse out the
/etc/group
file to list all users and the groups they are in.
Hi all,
I am trying to compare two arrays for a macro building system. I need to
start with the longest longest element from array 1 (the macros) and then
compare it to all elements in array 2. If a match is found, I replace the
match with '#0#' (replacing the number with the matching array
-Original Message-
From: Darin Weeks [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 4:31 PM
To: [EMAIL PROTECTED]
Subject: Comparing two arrays in longest element order
Hi all,
I am trying to compare two arrays for a macro building
system. I need to
start
Hi!
How can i repair (with a regular expression) a line with nothing inside ?
Thanks
Franck
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Darin Weeks) wrote:
I am trying to compare two arrays for a macro building system. I need to
start with the longest longest element from array 1 (the macros) and then
compare it to all elements in array 2.
Is there a simple way to cycle
Thanks a lot for the advice, Michael; I now got the code to work and am
adding it further below, just for the record.
--On Montag, 24. September 2001 09:07 -0800 Michael Fowler
[EMAIL PROTECTED] wrote:
my %hash = ('0' = 'miller', '1' = '32', '2' = 'copenhagen');
If you're indexing your
Hi,
I realize that this may not be the correct forum. If it isn't, you have
my sincere apologies.
I had PPM working on an older build of Activestate, and needed to upgrade.
Post upgrade PPM has stopped working. I've seen recommendations to migrate
to build 620 or higher to fix PPM problems,
Hi Kevin,
That's great, thanks for your prompt and welcoming reply. I'm glad to be
here.
I have posted my script to http://www.5forty.com/perl/htmlcompiler.plx so if
anyone has any time, I would be very grateful for any comments at all.
I am a complete novice, so won't take any offense at all,
At 05:04 PM 9/24/01 -0400, Kipp, James wrote:
Hi
I am the processing of writing a simple module and my brain just froze.
I am trying to valide data that is being passed to the object constructor
to make sure the arguments are acceptible. The args are being passed as
named arguments.
--
# hash of
On 9/24/01 10:53 AM, COLLINEAU Franck FTRD/DMI/TAM
[EMAIL PROTECTED] wrote:
How can i repair (with a regular expression) a line with nothing inside ?
s//what/;
???
-Sx-
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Sep 25, birgit kellner said:
Is there a simpler way than this to remove the last n elements of an array
and to reassign same array to the remainder?
You probably want to do:
splice @array, 0, @array - 3;
--
Jeff japhy Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI
List,
This may seem like an odd questiong but to avoid race conditions I need
to be able to run a Perl script from a Perl script (Ie execute it
without any user interaction). Is this possbile.
if (something = something) {
RUN NEW PERL SCRIPT HERE THEN CONTINUE WITH THE PERL SCRIPT
On Tue, 25 Sep 2001, Daniel Falkenberg wrote:
This may seem like an odd questiong but to avoid race conditions I need
to be able to run a Perl script from a Perl script (Ie execute it
without any user interaction). Is this possbile.
if (something = something) {
RUN NEW PERL SCRIPT
In article [EMAIL PROTECTED], [EMAIL PROTECTED]
(Randal L. Schwartz) wrote:
brian == brian d foy [EMAIL PROTECTED] writes:
brian In article [EMAIL PROTECTED],
brian [EMAIL PROTECTED] (Darin Weeks) wrote:
brian you can use a schwartzian transform to pre-compute the lengths,
brian then
List,
I have read and understood as much as I can about fork. But I have the
following problem where I need to start up a second script in my first
script. Problem is, if I have one already started as a deamon the
second won't start as a deamon. Am I doing something terribly wrong
here?
Hi
I am writing a script to automate a number of ufsdumps we do on our sun boxes. The
script I am using works fine, however I wish to send the output of the ufsdump
commands to a file and not display the output on the screen. The main reason is that
this file will store other info pertaining
72 matches
Mail list logo