Luke Bakken wrote:
>
> I'd thought I'd seen everything with perl until I saw John Krahn give
> this code as a solution:
>
> #syntax: unfold.pl filename > newfilename
>
> @ARGV or die "usage: $0 filename\n";
> $/ = '';
> print for grep [ chomp, s/\n\s+/ /g, s/\z/\n\n/ ], <>;
It's just a differe
On Sep 22, Gupta, Sharad said:
> package Foo;
> use overload q("") => sub {return shift->{bar}};
> $s = bless{bar=>"hello"}, Foo;
> print "$s\n"
>
>prints "hello".
Because you have overloaded "" for objects of class Foo.
> pac
On Sep 22, Bakken, Luke said:
>$/ = ''; print for grep [ chomp, s/\n\s+/ /g, s/\z/\n\n/ ], <>;
>
>I've never seen grep used with [ ] brackets before - it works the same
>with { }:
>
>print for grep { chomp, s/\n\s+/ /g, s/\z/\n\n/ } <>;
Not really. Here's an example:
print grep [ rand(2) < 1
Hi ALL,
I know i am missing something somewhere:
perl -e '
package Foo;
use overload q("") => sub {return shift->{bar}};
$s = bless{bar=>"hello"}, Foo;
print "$s\n"
'
prints "hello".
Whereas:
perl -e '
I'd thought I'd seen everything with perl until I saw John Krahn give
this code as a solution:
#syntax: unfold.pl filename > newfilename
@ARGV or die "usage: $0 filename\n";
$/ = ''; print for grep [ chomp, s/\n\s+/ /g, s/\z/\n\n/ ], <>;
I've never seen grep used with [ ] brackets before - it
On Mon, Sep 22, 2003 at 10:29:14PM +0100, Rob Dixon wrote:
> Daniel Liston wrote:
> >
> > John W. Krahn wrote:
> >
> > > Or you could pare that down a bit. :-)
> > >
> > > #!/usr/bin/perl
> > >
> > > #syntax: unfold.pl filename > newfilename
> > >
> > > @ARGV or die "usage: $0 filename\n";
> > >
On Mon, 22 Sep 2003 22:47:16 +0100, "Rob Dixon" <[EMAIL PROTECTED]> wrote:
> Daniel Staal wrote:
> >
> > --On Monday, September 22, 2003 19:23 +0100 Rob Dixon
> > <[EMAIL PROTECTED]> wrote:
> >
> > > I'm playing away here, as I know nothing about R
Hello,
I can't use a method called edges($u, $v) in the Graph::Base package. It will
use an internal method _edges defined in Graph::Directed package. Even I copy
this _edges() from Directed package to the Base package, I still can't use it,
The program freezed when I use '@e = $G->edges;'. I
Daniel Staal wrote:
>
> --On Monday, September 22, 2003 19:23 +0100 Rob Dixon
> <[EMAIL PROTECTED]> wrote:
>
> > I'm playing away here, as I know nothing about RPM other than
> > that it is a package manager and pro9bably specific to RedHat
> > Linux.
> >
> > Having said that, it looks like you are
Daniel Liston wrote:
>
> John W. Krahn wrote:
>
> > Or you could pare that down a bit. :-)
> >
> > #!/usr/bin/perl
> >
> > #syntax: unfold.pl filename > newfilename
> >
> > @ARGV or die "usage: $0 filename\n";
> >
> > $/ = ''; print for grep [ chomp, s/\n\s+/ /g, s/\z/\n\n/ ], <>;
>
> I like that
> $SIG{ALRM} = {
> `this-script`;
> exit;
> };
Sorry, didn't think it through (before anybody notices.). Remove the
thing that executes the script (the bit in backticks) and just have the
process start on a cron job.
Tired, apologies.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
Hi,
you could write a handler for the signal alarm that starts a new process and
kills the current:
$SIG{ALRM} = {
`this-script`;
exit;
};
At the beginning of the script set the alarm to go off 24 hours later:
alarm(84600);
DISCLAIMER: haven't really thought it through and it's really hac
Daniel Liston wrote:
Here is a tool I use to unfold long lines in LDAP outputs. It
also works on mailboxes that have the Received: lines or
Content-*: lines folded.
There are two things in your code that may cause a problem.
#!/usr/bin/perl
#syntax: unfold.pl filename > newfilename
if ($AR
Rmck wrote:
>
> Hi
Hello,
> I'm trying to get this to work in perl.
Which version of Perl?
> I want to start a unix process send it to a log file. Then at midnight
> kill it and restart it, with the date at the top.
Why do you need to kill and restart it? Can't you just print the date at
mid
There is an errmode() and dump_log(). Maybe that is what you are trying to
capture.
perldoc Net::Telnet
-Jeff
--- Daniel Staal <[EMAIL PROTECTED]> wrote:
>
>
> --On Tuesday, September 23, 2003 0:02 +0530 Pandey Rajeev-A19514
> <[EMAIL PROTECTED]> wrote:
>
> > Does Telnet.pm capture ou
--On Tuesday, September 23, 2003 0:02 +0530 Pandey Rajeev-A19514
<[EMAIL PROTECTED]> wrote:
Does Telnet.pm capture output from other than the STDOUT ?
I have a case where I telnet to a router through a console
connection. All commands work well and returns the output. But,
there is a special
--On Monday, September 22, 2003 19:23 +0100 Rob Dixon
<[EMAIL PROTECTED]> wrote:
I'm playing away here, as I know nothing about RPM other than
that it is a package manager and pro9bably specific to RedHat
Linux.
Having said that, it looks like you are trying to install a
module called MySQL::clie
Well, I looked at this library. But I'm afraid this won't serve the purpose
I've in mind. The specific needs I'm looking for are:
* Parse a certificate and return it's details (Such as DN, Issuer)
* Verify a certificate's integrity
* get a PEM encoded certificate from a DER-encoded and vice-versa
Hi,
I need an urgent help and direction regarding capture of scrolling text using the
Telnet.pm module.
Apart from the False Telnet servers(unusual ascii characters) described in the module,
ther is one more scenario where the output on a telnet session shell does not get
captured.
Does Tel
Rob Dixon wrote:
> .. you should use the Database Independent interface module
> 'DBI' together with the MySQL driver module 'DBD::MySQL', with
> which most Perl database programmers are familiar.
Strictly, that should be 'DBD::mysql'.
/R
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addit
Eric Rose wrote:
>
> This is the error message that I get when installing Mysql.
>
> #rpm -Uvh MySQL-client-4.0.15-0.i386.rpm
> error: Failed dependencies:
> perl(the) is needed by MySQL-client-4.0.15-0.i386.rpm
I'm playing away here, as I know nothing about RPM other than
that it is
[EMAIL PROTECTED] wrote:
> Hello,
>
> I'm having trouble grasping the syntax to perform foreach operation on an
> anonymous array within an anonymous hash reference.
>
> my $hashRef = { bah => "humbug",
>list => [ "lions", "tigers", "bears", "oh_my" ],
>woo => "hoo" };
here you have a h
Hi
I'm trying to get this to work in perl.
I want to start a unix process send it to a log file. Then at midnight kill it and
restart it, with the date at the top.
I'm starting with the following but the intial start of the proccess is not working
right:
#!/bin/perl
$date = `date | awk '{pri
Saifuddin Bohra/Hss wrote:
>
> Hi,
Hello,
> I am new to Perl. I have a follpwing shell script
>
> if [ -n "`netstat -na|grep LISTEN |grep 1099`" ];
> then
> exit 0
> else
> exit 1
> fi
>
> I need the perl script for the same job.
> and how to use this in another perl prog
Rob Dixon wrote:
>
> John W. Krahn wrote:
> >
> > my @records = do {
> >local ( $/, *FILE ) = '';
> >open FILE, $ARGV[0] or die "can't open $ARGV[0]: $!";
> >grep chomp, ;
>
> This will drop the last line of the file if there is no
> terminating separator.
>
> grep {chomp, 1} ;
Or
I first learned C, then C++, which was a good route for me. It gave
me a solid background in programming and structure that lends itself
well to learning other languages. I've begun to pick up perl in order
to aid in system administration, though I've been told that Python is
a great tool for tha
I'm sorry to post a unrelated question on the list,
but I was hoping somebody will have some kind of
answer for me since most of the people on the list
have their own sites and email addresses.
Really sorry to ask a question like that.
Ebaad.
--- Wiggins d'Anconia <[EMAIL PROTECTED]> wrote:
>
>
> How do you go about deciding if you
> should use another tool such as C++ over perl?
You basically look at the advantages and disadvantages of different
languages and decide which will be best for the task. For instance, if
you wanted to write a quick script to generate a Template file and fil
On Sun, 21 Sep 2003, Paul Kraus wrote:
> Perl was pretty much my first language. Not counting Business Basic and same
> old Pascal from high school. The more I learn the more I see that perl can
> handle just about anything I want to do. How do you go about deciding if you
> should use another too
--- Saifuddin_Bohra/[EMAIL PROTECTED] wrote:
>
> Hi,
> I am new to Perl. I have a follpwing shell script
>
> if [ -n "`netstat -na|grep LISTEN |grep 1099`" ];
> then
> exit 0
> else
> exit 1
> fi
>
> I need the perl script for the same job.
> and how to use this in another
On Sun, 21 Sep 2003 22:39:30 -0700 (PDT), Ebaad Ahmed <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to configure apache to host my own website on a
> solaris box. Please let me know how can I do it, I
> have read the FM but could not be confident en
Hi,
I am new to Perl. I have a follpwing shell script
if [ -n "`netstat -na|grep LISTEN |grep 1099`" ];
then
exit 0
else
exit 1
fi
I need the perl script for the same job.
and how to use this in another perl program
Any pointer ??
saifuddin
--
To unsubscribe, e-mail:
Jenda Krynicky wrote:
>
> Desmond Lim wrote:
>
> > I have 3 arrays @arr1, @arr2 and @arr3.
>
> Do not do that!
Yeah. I guess that summarises it :)
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
From: "Desmond Lim" <[EMAIL PROTECTED]>
> I have 3 arrays @arr1, @arr2 and @arr3.
Do not do that!
http://www.oreillynet.com/pub/a/network/2001/05/18/perl_redflags.html
Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to
John W. Krahn wrote:
>
> Daniel Liston wrote:
> >
> > Here is a tool I use to unfold long lines in LDAP outputs.
> > It also works on mailboxes that have the Received: lines
> > or Content-*: lines folded.
>
> There are two things in your code that may cause a problem.
>
>
> > #!/usr/bin/perl
> >
Desmond Lim <[EMAIL PROTECTED]> wrote:
:
: I have 3 arrays @arr1, @arr2 and @arr3.
:
: I need to print them into the same file and I'm doing this.
:
: open FILE, ;
: print FILE "@arr1\n";
: print FILE "@arr2\n";
: print FILE "@arr3\n";
: close FILE;
:
: I would like to shorten it to
:
: for ($
Desmond Lim wrote:
>
> I have 3 arrays @arr1, @arr2 and @arr3.
>
> I need to print them into the same file and I'm doing this.
>
> open FILE, ;
> print FILE "@arr1\n";
> print FILE "@arr2\n";
> print FILE "@arr3\n";
> close FILE;
>
> I would like to shorten it to
>
> for ($i=0;$i<4;$i++) {
> prin
I have 3 arrays @arr1, @arr2 and @arr3.
I need to print them into the same file and I'm doing this.
open FILE, ;
print FILE "@arr1\n";
print FILE "@arr2\n";
print FILE "@arr3\n";
close FILE;
I would like to shorten it to
for ($i=0;$i<4;$i++) {
print FILE "@arr$i\n";
}
I know there is an erro
I don't know which version of perl are you using but
I have just tried again the script i sent to you
And the ones with your modifications , both work well and do not
Die as you explained : fatal error "x outside of string"
Below is my perl -v output :
C:\>perl -v
This is perl, v5.6.1 built for MS
On Sun, Sep 21, 2003 at 09:17:38PM -1000 Marc Adler wrote:
> * Tassilo von Parseval <[EMAIL PROTECTED]> [2003-09-21 20:27]:
> > I was always of the opinion that knowing C is one of the essential
> > things. Too many vital stuff is nowadays hidden away from the user in
> > more recent languages (s
Wow, I didn't know that, and I have been using Perl for some time. Never
too old to learn.
>>
The answer is in 'perldoc perlsyn':
The "foreach" loop iterates over a normal list value and sets the
vari-
able VAR to be each element of the list in turn. If the variable is
precede
* Tassilo von Parseval <[EMAIL PROTECTED]> [2003-09-21 20:27]:
> On Sun, Sep 21, 2003 at 09:28:21PM -0400 Paul Kraus wrote:
>
> > Perl was pretty much my first language. Not counting Business Basic and same
> > old Pascal from high school. The more I learn the more I see that perl can
> > handle j
xposted to: perl.beginners, perl.beginners.cgi
I've wrote a web based program to store favorites online. I work on quite a
few computers each week between home, work, and school and its something
I've wanted for awhile. The program is account based so others can use it.
It is free to use. The home
43 matches
Mail list logo