hi,
i know there is a perl tk mailinglist but i don't want to
do all this subscribe stuff atm so i ask here since you
all helped me a lot already (thanks a lot again) :-)
i've got a perl/tk script including a Menu frame
use Tk;
$mw = MainWindow->new;
$mw->title("whatever")
Hi All,
I need your help to compare the file timestamp of 2 different files, Please suggest
how can I do this in perl.
Thanks & regards,
Amit.
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. T
Well, I got the out put that I wanted. the use
Data::Dumper; call really helped with my debugging,
thanks for the tip. I understand what's going on
except for the printing and the foreach loops, can
someone break that down for me? Also, any other
resources on foreach loops? Thanks in advance,
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
open
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
> charact
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 compl
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 empty. Shouldn't I
be able to get the
You could also do something like this.
foreach $uid (%file1)
{
if ( ($file1{$uid} =~ /$file2{$uid}/) || ($file2{$uid} =~ $file1
{$uid}))
{
print "A duplicate has been located\n";
}
}
"The right word may be effective, but no word was ever as effective as a
right
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 empty. Shouldn't I
be able to get the warning message out of there? Thanks for any
insights.
James
--
To
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";
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.
Ar
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
---
> 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 mea
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
> > lev
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 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 i
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/;
$result =~ s/\s//g;
return $result;
}
Can anybody point me out why
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 ge
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 ().
So if possible
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 c
> >
> > 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
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 com
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. If
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 pro
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
fulfillme
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 wan
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
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}
> -
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
> 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}
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
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 poi
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 modu
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
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 t
> 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 c
--- 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 c
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
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 it
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
> 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 i
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
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 unsubscr
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]
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
> nam
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
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 committe
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: [
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 want
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 all
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,
m
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
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
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
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 con
56 matches
Mail list logo