.
> What about any specific modules that are useful?
> Any other advice?
If you're interested in object oriented perl, read 'perldoc perltoot'.
Interesting modules depend on what problem you're trying to tackle.
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe,
nore most white space when rendering HTML. Since you're
trying to present tabular data, you should put in inside a table. That
should fix your formatting problems.
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional command
On Thu, 2006-08-17 at 14:21 -0700, chen li wrote:
> Dear all,
>
> Is it possible to create a serial of array name using
> a loop, such as @array0,@array1, @array2, ..., to
> @array(n-1)?
Yes, it is possible.
Why do you want to do that, though?
--
Joshua Colson <[EMAIL PR
On Tue, 2006-08-15 at 07:51 -0700, chen li wrote:
> Dear all,
>
> What is the formula of 2 to 4(the result is 16)in
> Perl?
perl -e 'print 2**4;'
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-m
print $number, "\n";
__END__
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On Wed, 2006-08-09 at 16:34 -0600, siegfried wrote:
> I have daily cron jobs that clobber their old log files everyday.
>
> How can I automate keeping the last 3 log files and delete the oldest one
> everyday?
>
If you're using a UNIX-like OS, why not just use logrotate
On Tue, 2006-08-01 at 11:38 -0500, JupiterHost.Net wrote:
> perl -mstrict -wle '$gl="why am I not throwing errors?";print $gl;'
That should be a capitalized 'M':
perl -Mstrict -wle '$gl="why am I not throwing errors?";print $gl;'
HTH
--
J
cular "\n" is *not* CRLF on Windows.
>
> My article about newlines is moving forward at O'Reilly, I hope I can
> soon provide a pointer to it. Misconceptions about newlines arise too
> often, which was my main motivation to write it.
Thank you for the clarificatio
On Fri, 2006-07-28 at 21:28 +0200, Dr.Ruud wrote:
> Robert Citek schreef:
>
> > Try a different value for the INPUT_RECORD_SEPARATOR ($/):
> >
> > $/ = "\n" ;
>
> (spaces added for clarity)
>
> Is that different from the default?
> (see perlvar)
/Format/Epoch.pm
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
FILE,">>",$fname or die $!;
>
> foreach (@vob_list)
> {
> print "Following are the triggers applied for $_ VOB\n\n";
> # my $cmd = "$CT lstype -kind trtype -invob $_";
my $cmd = "$CT lstype -kind trtype -invob $_ > ${_}.out";
>
; file type. If such a file is
> found within the "$base_dir" directory then that file should be deleted.
What have you tried so far that has not worked for you?
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [
by the foreach?
>
You could eval() the string, but a better solution is outlined in Dr.Ruud's
message because if you eval() the string that is passed in, you're opening
yourself up to a trivial exploit of your code by the user.
--
Joshua Colson <[EMAIL PROTECTED]>
--
To un
alar
my @list4 = ( 0..10, 33..43, 100..111 );
>
> #foreach (0..10,33..43,100..111){
> #foreach ($list4){
foreach (@list4) {
>
> $array[$_] = $_;
>
# this next statement is going to print a bunch of nothing
# useful as there are no values in the array
>
27;First Element';
push @{$array}, 'New Element';
}
my @array = qw( first second third );
test_array([EMAIL PROTECTED]);
print $array[0] . "\n";
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional c
at document (admittedly, not very
hard) and couldn't find it. The closest I found was 'perldoc -q lib'
which is must less precise considering the subject at hand.
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
#x27; statement causes Perl to add that directory to the list of
directories that it will search to find 'Widget::Factory'.
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On Thu, 2006-07-20 at 15:40 +0530, Shourya Sengupta wrote:
> Suppose the package is installed in a different path.
> Can we then mention the full path of the package in statesments like
> this? eg
>
> use
perldoc -q lib
hint: 'use lib...'
--
Joshua Colson <
On Thu, 2006-07-06 at 17:14 -0400, Ryan Moszynski wrote:
> -
>
> 1 - Use of uninitialized value in hash element at ./clearwhite.pl line 522.
> ##
>
> print "Exists\n" if exists $top{$getgroup}{IOTESTS}{0} ;
> print "Defined\n" if defined $top{$
tries every
possibility. There are examples in the archives about how to overcome
this. However, I am unable to find them at the moment.
I'm sorry for not having the real answer to your question.
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
is not giving
> me the correct ouptut.
Why don't you just use a shell tool like nmap for this? Something like
(assuming all the IPs are the only thing in the file):
cat ips.txt | xargs nmap -sP
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
thanks for the care & support
Try running file and strings on the executable:
[EMAIL PROTECTED]> file test1.cgi
test1.cgi: ASCII English text
[EMAIL PROTECTED]> strings test1.cgi
[ a bunch of character strings ]
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe
hanks.
---
#!/usr/bin/perl
use strict;
use warnings;
my $date = "Wed Jun 7 14:27:38 2006';
print $3 if $date =~ m{(Wed)\s(Jun)\s{1,2}([1..31])};
__END__
--
Joshua Colson <[EMAIL PROTECTED]>
iNation, LLC
--
To unsubscribe, e-mail:
n at
least a few times in the past that I've wanted to achieve the same thing
and it always ends up looking like comic book curse words. Also, I
prefer to validate the input. This example would match even if the third
column weren't digits (more specifically, digits in the range of 1 to
31)
}x;
>
Isn't there a more reader friendly way to do this. When I look at that,
it isn't immediately apparent that the portion of regex is looking for
any number between 1 and 31, inclusive.
Thanks.
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscrib
On Wed, 2006-06-07 at 16:20 -0600, Jeremy Vinding wrote:
> Joshua Colson wrote:
> >
> > print $3 if $date =~ m{(Wed)\s(Jun)\s{1,2}([1..31])};
> >
> I believe you'd have to use alternation.
>
> for example, something like:
> /(0?[1-9]|[12][0-9]|3[01])/
>
hanks.
---
#!/usr/bin/perl
use strict;
use warnings;
my $date = "Wed Jun 7 14:27:38 2006';
print $3 if $date =~ m{(Wed)\s(Jun)\s{1,2}([1..31])};
__END__
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROT
On Fri, 2006-05-26 at 09:45 +1000, Keenan, Greg John (Greg)** CTR **
wrote:
> --start--
> use strict;
> use warnings;
>
> my $cfgDir = '/amanda/admin/etc/amanda';
> my @cfgs = qw(Toaster MFG-UNIX SYS-UNIX Amanda-Daily);
> my %numTapes = (
> "$cfgs[0]" => 6,
> "$cfgs[1]" => 5,
> "$cfgs[2]"
On Thu, 2006-05-25 at 19:38 +, Saurabh Singhvi wrote:
> Hi
>
> the format of split() defines that one
> can split a string into a fixed number
> of specifies strings. for eg
>
> ($login, $passwd, $remainder) = split(/:/, $_, 3);
>
> Now, the thing is, it splits on first 3 parts.
> Can i do t
#x27;d have to kill me but all I can say is, I
> can't freaking wait to be able to use that "successful application of Perl"!
>
Can you point it out to us after their 10th anniversary?
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
On Wed, 2006-05-17 at 10:57 -0400, Zembower, Kevin wrote:
> Any advice on correcting my script? Thanks in advance for your
> suggestions.
>
perl -e 'while (<>) { $seen{$1}++
if /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/; } print join("\n",sort keys %
seen) . &quo
On Fri, 2006-05-12 at 10:50 -0500, SkyBlueshoes wrote:
> I've googled it over and over, but I can't find the way to hide the
> input of a password on the console screen. I know it can be done...
http://search.cpan.org/~nwclark/perl-5.8.8/pod/perlfaq8.pod
--
Joshua Colson &
gt; text format emails. I'm not 100% sure how that one is done, but I know
> it can be done, that way email clients that don't support HTML will
> revert back to the plain text format.
If you want to include both HTML and text versions of a message, you
need to encode it as a mult
he 'net use'
command are specified in a different order. To handle that you'll need a
much more complex regex. "Mastering Regular Expressions" is a fine book
on the subject.
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
is important because HTML does not require a specific
case for
# the 'href' part.
}
print join("\n", @urls);
__END__
##
Output:
http://www.cpan.org/
http://search.cpan.org/~gaas/HTML-Parser-3.51/lib/HTML/TokeParser.pm
http://search.cpan.org/~ovid/HTML-TokeParser-Simple-3
ing parrallel 'jobs' on different machines you
should probably be looking into openmosix or beowulf clustering. Not
that it cannot be done in perl, just the right tool for the right job.
--
Joshua Colson <[EMAIL PROTECTED]>
VoidGate InterNetworks
--
To unsubscribe, e
On Mon, 2006-04-17 at 14:08 -0700, Timothy Johnson wrote:
> Was this logfile made by a particular product? There might be a module
> made specifically for it.
No. It is a home brewed application.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ess the previous x number of records.
Thanks.
--
Joshua Colson <[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
the results by 'map'ing the sorted hash keys to a line in the
# format of:
# [this] => [number]
print map { "[$_] => [$wc{$_}]\n" } sort keys %wc;
# print the results again, this time sorted by number of times the word
# was encountered in the file by overriding the s
On Fri, 2006-04-07 at 16:36 -0400, [EMAIL PROTECTED] wrote:
> On Fri, 07 Apr 2006 16:02:53 -0400, Oliver Block <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> >> I understand regex, but the following fails:
> >> open PAGE, 'c://redcross.htm';
> >> while( my $line = ) {
> >> # $line =~ /Health and
# Sample code:
use Date::Calc qw(:all);
$days = Days_in_Month('2006','04');
print $days;
# End Sample
You'll need the Date::Calc module from cpan
(http://search.cpan.org/~stbey/Date-Calc-5.4/Calc.pod).
On Tue, 2006-04-04 at 13:49 -0500, Mike Blezien wrote:
> Hello,
>
> I am trying to come
://www.site.com/val1/val2/val3/val4.html
to something like
http://www.site.com/perl-bin/script.pl?var1=val1&var2=val2&var3=val3&var4=val4
Then you have access to all of them via CGI and Google is happy with the
link.
HTH
--
Joshua Colson <[EMAIL PROTECTED]>
Sr. Systems Administra
row->{leaseopid},
> -size=>8,
> -maxlength=>8),p,"\nName: ",
>
--
Joshua Colson <[EMAIL PROTECTED]>
Sr. Systems Administrator
Giant Industries, Inc
P: (480) 585-8714
F: (480) 502-6641
signature.asc
Description: This is a digitally signed message part
MD5->import() is being called becasue if you add
> something that it does not export you get teh error about it not being
> exported by that module.
>
> it just importing it to FooTest (IE see funk()) but I need it imported
> to the where ever it was use()ed from.
>
--
Joshua Colson <[EMAIL PROTECTED]>
Sr. Systems Administrator
Giant Industries, Inc
P: (480) 585-8714
F: (480) 502-6641
signature.asc
Description: This is a digitally signed message part
9
> Fax +39 02 25514303
> [EMAIL PROTECTED]
> www.enter.it - www.enterpoint.it
> ---
> Gruppo Y2K - www.gruppoy2k.it
>
>
--
Joshua Colson <[EMAIL PROTECTED]>
Sr. Systems Administrator
Giant Industries, Inc
P: (480) 585-8714
F: (480) 502-6641
signature.asc
Description: This is a digitally signed message part
27;re using GNU/Linux or similar).
On Wed, 2004-12-01 at 10:29 +0200, John wrote:
> Has anyone know how to do that task?
>
> It think that is quite easy as far as pdf is a set of images.
--
Joshua Colson <[EMAIL PROTECTED]>
Sr. Systems Administrator
Giant Industries, Inc
P: (4
e:
use lib $path;
However, it seems to me that you want to be able to directly call some
function within a package (ie. test_sub()) without having to prepend the
package name and '::' separator. This is only possible if the package
exports the subs into your namespace when use/require
jcolson:/tmp$ perl -v
This is perl, v5.8.0 built for i386-linux-thread-multi
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-2002, Larry Wall
GnuPG-Interface version 0.33
MethodMaker version 2.02
GnuPG version 1.2.1
Thanks again for all t
created. You may need to call
> it on $cipherfile as well.
I set autoflush to true on all of the filehandles but it is still
hanging. Do you still have any of the code you had written for testing
GnuPG::Interface in the past? I would be interested to see exactly how
you did it tha
ger
> files fo1r performance issues without problems, but always used
> unbuffered handles.
Could you please tell me how you turned off buffering for the
filehandles?
Thanks.
Joshua Colson
Systems Adminstrator
Giant Industries, Inc.
signature.asc
Description: This is a digitally signed message part
gt;;# reading the error
my @status_info = <$status_fh>; # read the status info
print "#" x 80 . "\n";
print @error_output;
print "#" x 80 . "\n";
print @status_info;
print "#" x 80 . "\n";
print @plaintext;
# clean up...
close
It looks to me like you're trying to dereference the wrong hash.
Try this...
sub COMMENTSYNC {
my($rule,$data) = @_;
my($crule,$temp,@map,$count);
foreach my $item ( keys %{$data} ) {
print ${$item}{'rule_desc'} . "\n";
}
}
If the $data is a reference to a hash of hashes, then when t
# Set $header_file to the PATH to header.incl
my $header_file = 'header.incl';
# Call load_file() which takes a filename as an argument and
# returns the contents of that file. Then print what load_file()
# returns.
print load_file($header_file);
sub load_file {
my($file,$html) = shift;
$html
How about just:
@list = (qw(two one none zero seven two zero))
foreach my $elem ( @list ) {
$list{$elem}++;
}
@list = ();
foreach my $key ( keys %list ) {
push(@list,$key);
}
To explain:
Each non-unique element in the list will simply increment the unique
hash key, then read back all t
s it as the literal string.
Well, if anyone has any idea's I would appreciate any help I can get.
Thanks.
Joshua Colson
signature.asc
Description: This is a digitally signed message part
Does anyone have any pointers of where I might learn to use
authentication (username/password) with VFS::Gnome?
Any help would be appreciated.
Also, please cc me, as I often miss the email from the list.
Thanks.
Joshua Colson
signature.asc
Description: This is a digitally signed message part
You should be using syntax like:
if ( $a == 20 ) { print ... }
When you say:
if ( $a = 20 ) { ... }
you are actually assigning the value 20 to $a. Which was successful, hence
the if statement is evalutated to 'true'.
Regards,
Joshua Colson
Systems Administrator
Giant Industrie
(\d{1,2}) (\d{2}):(\d{2}):(\d{2}) (\d{4})/ ) {
print "$6 $month{$1} $2 $3 $4 $5\n";
}
}
close( LOG ) or die "Cannot close log file: $!";
I hope that gets you on the right track.
Comments or suggestions are welcome.
Joshua Colson
Systems Adminis
webserver converts spaces in a URL, but I don't know if a FTP server could
handle that, or how to do it if it could.
Any help would be great!!
Thanks.
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480) 585-8714
[EMAIL PROTECTED]
I've commented out two lines in your code and replaced them with mine.
I think it should work, but let us know if it doesn't.
Good Luck!
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480) 585-8714
[EMAIL PROTECTED]
-Original Message-
From: John Edwards [mai
or a 'c',
(\d+) - same as above, except that it is next to the '$' at the end. which
means that the numbers must go to the very end of the line.
I hope that was enough detail, and that it helps you out.
Good Luck,
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(48
For the sake of argument we'll assume that you've assigned your list to an
array named @LIST.
Try this.
@NEWLIST = grep(!/^$/, @LIST); # Grep the list for any element that is not
empty.
Now @NEWLIST should only contain those entries that have some content to
them.
Hope this helps.
-Origina
ly to change
the GCOS fields, and occasionally to rename a user.
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480) 585-8714
[EMAIL PROTECTED]
time this is run,
it would double the size of the file. But it doesn't, it just reads the
first line, prints it to STDOUT, but not the file again, and exits. I have
the sticky bit set on the script, and I don't know if that is what is
causing it. Any Ideas?
Joshua Colson
Systems
each list into a hash, and checking
to see if the keys are defined in the other groups hash, but I'm sure that
there is a better way. So, if anyone knows what it is, I would appreciate
the help.
Thanks!
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480) 585-8714
[EMAIL PROTECTED]
Hello all.
I want to parse the named.conf file, basically the same way that named
does it.
I need to be able to store the values of the reserved words in variables.
Does anyone know of a good way to parse a conf file?
TIA
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480
sub return_scalars {
$scal1 = 5; Assign values to scalars somehow
$scal2 = 7;
return \$scal1, \$scal2;
}
($test_scalar1, $test_scalar2) = &return_scalars();
-Original Message-
From: Roy Peters [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 31, 2
From: Rex Arul [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 5:08 PM
To: Joshua Colson
Subject: Re: Net::FTP
OK Josh, let us try this:
Why don't you try an ordinary command-line ftp and try to give a get command
for the file-name in question? This way we can isolate the problem a
No, I haven't tried that yet... I'll do that now.
Thanks
-Original Message-
From: Rex Arul [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 5:08 PM
To: Joshua Colson
Subject: Re: Net::FTP
OK Josh, let us try this:
Why don't you try an ordinary command-line ftp
Well, that didn't work, unfortunantly.
I'm pretty much stumped!
If anyone knows the answer... Please HELP me!!!
Thanks
P.S. Thanks for the suggestions Rex.
-Original Message-
From: Rex Arul [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 4:37 PM
To: Joshua Colson
S
I'll try it... Thanks
-Original Message-
From: Rex Arul [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 26, 2001 4:37 PM
To: Joshua Colson
Subject: Re: Net::FTP
I might sound silly...Did you try this:
if( $ftp->get( qq($file), "${directory}/${file}" ) ) {
;get( $file, "${directory}/${file}" ) ) {
print "it worked...";
}
It works on some files, but not others...
Any help would be greatly appreciated!!
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480) 585-8714
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
You cannot push and pop a (%) hash. But If you want to retain the original
values, just copy them to a temporary hash. i.e.
%temphash = %ENV;
delete %ENV{'HOME');# Operate on %ENV
%ENV = %temphash; # Restore %ENV
-Original Message-
From: Daryl J. Hoyt [mailto:[EMAI
Is it possible to open a file for writing in an suid cgi program? If so,
how?
Joshua Colson
Systems Administrator
Giant Industries, Inc.
(480) 585-8714
[EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
74 matches
Mail list logo