On Tue, Jun 10, 2003 at 09:32:53AM -0400 Rick Ressegger wrote:
If I want to know what version of a module is already installed on a system,
how can I disclose this?
Either use Janek's suggestion or ask for the value of $VERSION for the
module in question:
perl -MSome::Module -e 'warn
I use a homeboy data base technique to keep info about the scripts I
write and other typse of stuff too. Here I'm just dealing with
scripts.
Its a simple format to enter key information about what a script
does. Looks like:
# Keywords: SOME WORDS
# body
# body
# DATE
#
I've written various
Thanks Rob, this has been very helpful. I wanted to know why the second
form is an abuse of perl. Since I'm new to perl, it is helpful to kn ow
what is good programming practise.
Tx.
H
On Tue, 2003-06-10 at 15:39, Rob Dixon wrote:
Hamish Whittal wrote:
Hi All,
I'm still a little
On Tue, Jun 10, 2003 at 11:49:25PM -0700 Harry Putnam wrote:
I use a homeboy data base technique to keep info about the scripts I
write and other typse of stuff too. Here I'm just dealing with
scripts.
Its a simple format to enter key information about what a script
does. Looks like:
Hi,
i've got a problem with regexp,
i have a multiline string like
this is
a multi
line string
and i want to do a regexp that replaces
everything that is NOT a,b,c or d
with \s, except \n of course.
i got something like
$string =~ s/![abcd]//g;
but that doesn't work, maybe because
it
Jaschar Otto wrote at Wed, 11 Jun 2003 11:53:11 +0200:
i've got a problem with regexp,
i have a multiline string like
this is
a multi
line string
and i want to do a regexp that replaces
everything that is NOT a,b,c or d
with \s, except \n of course.
\s is not one character, it
Hi
\s is not one character, it stands usually for a whole character class!
Do you mean an empty string () or just a blank ( ) instead?
i ment a blank ( ).
character class negation works with [^...],
in your case it would be
$string =~ s/[^abcd]//g;
Thanks a lot, that worked perfect,
maybe i was
Hi All,
I have a module OraMod.pm that exports some subroutines
I also have Common.pm which sets up a whole host of environment
variables for use throughout all the modules that I have created. What I
now want to do is, instead of placing the
use OraMod qw(sub1, sub2, sub3) at the top of
Hi all,
Anyone know if the perl module File::Copy can handle
date checks? Or whether there is another module that
only deals with copying files that are newer than the
ones they are over-writing?
Similar to the Xcopy /D: command
[I don't want to use a batch file at the moment in
case someone
Airman wrote:
Does anyone know how to reference different DNS servers when
using gethostbyname. I want to check up to three different
nameserver for consistency checking.
Use Net::DNS module instead. gethostbyname() isn't really designed for that
kind of thing.
--
To unsubscribe, e-mail:
I have a hash called fouls. Within that hash, there
are other hashes called offensive, personal, and
shooting. The keys to those hashes are names, like
Smith, Rodriguez, and Chan. and the values to those
names are numbers.
I think if I wanted to access the number of offensive
fouls Chan
Chern Jian Leaw wrote:
From: Rob Dixon
Chern Jian Leaw wrote:
I have a text file below which is simply an output from the UNIX utility
rpcinfo:
181 udp 55734 walld program 18 version 1 ready and
waiting
1073741 udp 64018 rpcinfo: RPC:
Hi Stuart.
This project of yours is coming along nicely!
Stuart White wrote:
I have a hash called fouls. Within that hash, there
are other hashes called offensive, personal, and
shooting. The keys to those hashes are names, like
Smith, Rodriguez, and Chan. and the values to those
names
Could someone direct me to the correct module to use for monitoring an
Internet connection? I just want to see the IP addresses of the machines
trying to get into my PC.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On Wednesday, June 11, 2003, at 05:14 AM, Jaschar Otto wrote:
$string =~ s/[^abcd]//g;
Thanks a lot, that worked perfect,
Transliterate is probably a better choice for this kind of thing. It's
certainly more efficient. You would use it like this:
$string =~ tr/abcd/ /c;
James
--
To
Steps:
1. Install Windump http://windump.polito.it/
2. Watch logfile, or write perl script to parse log file.
Luke
-Original Message-
From: DiGregorio, Dave [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 7:04 AM
To: Bakken, Luke
Subject: RE: very beginner
Win ME
On Wednesday, June 11, 2003, at 05:14 AM, Jaschar Otto wrote:
$string =~ s/[^abcd]//g;
Thanks a lot, that worked perfect,
Transliterate is probably a better choice for this kind of
thing. It's
certainly more efficient. You would use it like this:
Just curious, how is it more
In article [EMAIL PROTECTED],
[EMAIL PROTECTED] (Hamish Whittal) writes:
Hi All,
I have a module OraMod.pm that exports some subroutines
I also have Common.pm which sets up a whole host of environment
variables for use throughout all the modules that I have created. What I
now want to do
On Wednesday, June 11, 2003, at 09:21 AM, Dan Muey wrote:
On Wednesday, June 11, 2003, at 05:14 AM, Jaschar Otto wrote:
$string =~ s/[^abcd]//g;
Thanks a lot, that worked perfect,
Transliterate is probably a better choice for this kind of
thing. It's
certainly more efficient. You would use
Dan Muey wrote:
On Wednesday, June 11, 2003, at 05:14 AM, Jaschar Otto wrote:
$string =~ s/[^abcd]//g;
Thanks a lot, that worked perfect,
Transliterate is probably a better choice for this kind of
thing. It's
certainly more efficient. You would use it like this:
Just
--- Rob Dixon [EMAIL PROTECTED] wrote:
Hi Stuart.
This project of yours is coming along nicely!
Thanks, I'm getting some help from a tutor and you all
on this list, which is helping me move along much
faster than I could have done by myself.
Stuart White wrote:
I have a hash called
The caret at the start of a character class negates the
sense of the class, so /[abcd]/ matches a character which is
any one of the four letters 'a', 'b', 'c' or 'd'. /[^abcd]/
will match any single character except these four. In the expression
Ooo yeah the brackets change the
Stuart White wrote:
--- Rob Dixon [EMAIL PROTECTED] wrote:
Stuart White wrote:
I have a hash called fouls. Within that hash, there
are other hashes called offensive, personal, and
shooting. The keys to those hashes are names, like
Smith, Rodriguez, and Chan. and the values to
Hi Ben
Ben Crane wrote:
Anyone know if the perl module File::Copy can handle
date checks? Or whether there is another module that
only deals with copying files that are newer than the
ones they are over-writing?
Similar to the Xcopy /D: command
[I don't want to use a batch file at the
You could always use stat() on the files to decide which ones you want to
copy...
-Original Message-
From: Ben Crane [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 11, 2003 4:31 AM
To: [EMAIL PROTECTED]
Subject: File::Copy - Additional Parameters?
Hi all,
Anyone know if the perl
Tassilo von Parseval [EMAIL PROTECTED] writes:
You don't have to keep track of the line numbers yourself. Perl offers
the special variable $. for that.
An awkism I guess, hold over from awk use.
Thanks for the tips.
I'd probably write it like that:
Quite a lot shorter... and to the point.
Hi everybody!
Could You pease point me where I can get answers following questions:
1. How can I now the UID of the user who started perl-script?
2. How can I change UID/GID the script is running under. I need to start
script with root privilegies and when drop them to apache.apache.
Thanks in
snip
Conceptually, what you have is a tree. There are
three
branches from the root, one for each foul type, and
each of these is split into a further three
branches,
one for each player.
Like this:
--Rodriguez{numFouls}
--offensive--Chan{numFouls}
On Wed, 11 Jun 2003, tsg wrote:
Hi everybody!
Could You pease point me where I can get answers following questions:
1. How can I now the UID of the user who started perl-script?
Try $ (or $UID or $REAL_USER_ID with use English) for the real user id.
Try $ or $EUID or $EFFECTIVE_USER_ID with
Stuart White wrote:
Conceptually, what you have is a tree. There are
three
branches from the root, one for each foul type, and
each of these is split into a further three
branches,
one for each player.
Like this:
--Rodriguez{numFouls}
Tassilo Von Parseval wrote:
On Tue, Jun 10, 2003 at 11:49:25PM -0700 Harry Putnam wrote:
## Set a marker to know when we are in a new file
$fname_for_line_cnt = '';
for (@files) {
chomp;
I don't think that the entries in @ARGV contain newlines at the end.
Actually I know they
On Wednesday, June 11, 2003, at 01:21 PM, Rob Dixon wrote:
Time to go and play with hashes for a while! Start with
the simplest imaginable hash
my %hash;
$hash{A} = 1;
and dump it. Then add additional data, then additional
levels, and get a feel for what the operations are doing.
Just
Dave Digregorio wrote:
Could someone direct me to the correct module to use for monitoring an
Internet connection? I just want to see the IP addresses of the machines
trying to get into my PC.
Get a progam like Ethereal: http://www.ethereal.com/
:-)
John
--
use Perl;
program
fulfillment
Hi All;
I would like to match a string if it has only cero or more of a defined
set of characters.
For example:
if GACT are the characters, then
GACTNGACT ## This string should not be matched because it has the extra
character N
GACCC ## This could be matched;
Any help to solve this
Hi All:
I added the following line to my program:
$/ = \65536;
This was because I'm running out of memory when slurping entire files into
memory (potentially hundreds of meg). However, the (separate) log file I'm
writing afterwards is not getting created - nor am I getting any error
messages.
Say I have two large lists of names (uid's). I would like to look at
both of these files and make sure that a name (uid) doesn't appear in
BOTH files. Just one or the other. Not sure how to handle that. Any ideas?
Thanks.
-James
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Could someone direct me to the correct module to use for
monitoring an
Internet connection? I just want to see the IP addresses
of the machines
trying to get into my PC.
Get a progam like Ethereal: http://www.ethereal.com/
or:
netstat
tcpdump
lsof
and roll your own with Socket
Pedro Antonio Reche wrote:
Hi All;
I would like to match a string if it has only cero or more of a defined
set of characters.
For example:
if GACT are the characters, then
GACTNGACT ## This string should not be matched because it has the extra
character N
GACCC ## This could be
From: Rob Das [EMAIL PROTECTED]
I added the following line to my program:
$/ = \65536;
It'd be better to use
read FILE, $buffer, 65536;
and leave $/ alone. Keep in mind that $/ is global and affects all
filehandles you try to read from using the diamond operator (FILE).
So if
Rob Das wrote:
Hi All:
I added the following line to my program:
$/ = \65536;
This was because I'm running out of memory when slurping entire files into
memory (potentially hundreds of meg). However, the (separate) log file I'm
writing afterwards is not getting created - nor am I getting
James Kelty wrote:
Say I have two large lists of names (uid's). I would like to look at
both of these files and make sure that a name (uid) doesn't appear in
BOTH files. Just one or the other. Not sure how to handle that. Any ideas?
The short answer is
perldoc -q duplicate
The long one is,
Jair Santos wrote:
Hi all,
say that
use strict;# always
use warnings; # usually
$directory = C:\\directory\\*.*
Use single quotes for cuter code.
my $directory = 'C:\directory\*.*';
and I am trying to remove the *.* from the end using
$directory = trim($directory);
James Edward Gray II wrote:
On Wednesday, June 11, 2003, at 01:21 PM, Rob Dixon wrote:
Time to go and play with hashes for a while! Start with
the simplest imaginable hash
my %hash;
$hash{A} = 1;
and dump it. Then add additional data, then additional
levels, and get a
Hi all,
say that
$directory = C:\\directory\\*.*
and I am trying to remove the *.* from the end using
$directory = trim($directory);
where
trim is
sub trim {
my( $result) = @_;
$result =~ s/^\s+(.*?)\s+$/$1/;
Because . And * have special meanings in a regex.
Is there an easy way to go back and forth between decimal and hex in perl.
I know of the hex function which solves my hex to dec problem but how about
a dec-hex function or module? I need the value which is why printf isn't
working for me.
Thanks for any help.
-Ken
Ken Lehman [mailto:[EMAIL PROTECTED]
:
: Is there an easy way to go back and forth between
: decimal and hex in perl. I know of the hex function
: which solves my hex to dec problem but how about a
: dec-hex function or module? I need the value which
: is why printf isn't working for me.
Here is an example that i posted some time ago, :
~~ cut
use Socket;
use Fcntl;
use POSIX;
my $PORT=2100;
my $proto=getprotobyname('tcp');
socket($socket,AF_INET,SOCK_STREAM,$proto) || die couldn't get socket:
$!\n;
bind($socket,sockaddr_in($PORT,INADDR_ANY)) || die couldn't bind: $!\n;;
James Edward Gray II wrote:
On Wednesday, June 11, 2003, at 05:27 PM, James Edward Gray II wrote:
I'm setting the warning signal ($SIG{__WARN__}) to my own handler,
redirecting warnings to my log file. It is working. I can see the
call come through, but the passed @_ is completely
Pedro Antonio Reche wrote at Wed, 11 Jun 2003 13:38:18 -0500:
I would like to match a string if it has only cero or more of a defined
set of characters.
For example:
if GACT are the characters, then
GACTNGACT ## This string should not be matched because it has the extra
character N
Hi Rob:
I'm trying to merge a whole bunch of files (possibly tens of thousands) into
one file. Here's my code (with the error checking removed for readability):
opendir(INDIR, $indir);
@logfile=grep(/$mask/i, readdir INDIR);
closedir(INDIR);
[EMAIL PROTECTED]; # number of files matching mask
Hamish Whittal wrote:
Thanks Rob, this has been very helpful. I wanted to know why the second
form is an abuse of perl. Since I'm new to perl, it is helpful to kn ow
what is good programming practise.
Because it adds characters and notation that serve no purpose, which serves
no purpose.
51 matches
Mail list logo