As far as I can see you aren't missing anything.
perl -e '$a=foo [ 0 ] = function(1,2,3,4); $a=~/(\w+)\(/; print $1'
works great for me. =)
But you might think about using this:
perl -e '$a= foo [ 0 ] = function (1,2,3,4); $a=~/\b(\w+)\b\s*?\(/;
print $1'
The zero width assertion \b and the
Very strange... What platform and perl are you on? I'm on RH7.3 perl
5.6.1. And could you try this:
my $a= foo [ 0 ] = function(a,b,v,t);
$a=~/\b(\w+)\b\s*?\(/;
print \$` =|$`|\n\$ =|$|\n\$' =|$'|\n\$1 =|$1|\n;
__END__
My output is this:
$` =| foo [ 0 ] = |
$ =|function(|
$' =|a,b,v,t)|
$1
Bastian Angerstein wrote:
Hello there,
Hello,
I have a cmd-PRogramm which produce multiline output.
/usr/testdrive.
I call this proggi from perl:
`/usr/testdrive -e -k | grep /home`;
This programm produce multiline Output,
how do I get this into a variable
my $variable = `/usr/testdrive -e -k |
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print $result\n;
Now, when I run the
This works:
#!/usr/bin/perl
use strict;
use diagnostics;
my $host = www.netbsd.org;
my $count = 0;
system(ping -c 5 $host);
=
thx,
Radhika
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
TapasranjanMohapatra wrote:
Hi All,
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print $result\n;
-Original Message-
From: radhika [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 22, 2005 12:37 PM
To: beginners@perl.org
Subject: Using the perl debugger with options
Hi,
I am a beginner perl programmer (but not exactly a novice)
and am writing
a perl module which is
Did you try:
perl -d /path/to/my_perl_script --install --dbname=blah
That works for me on my scripts with Getopt::Long
Hi,
I did try:
perl -d ./my_script --install --dbname=bbb
That did not seem to work for me. It could be that certain modules I am
writing are not loading properly.
On Wed, 23 Feb 2005, TapasranjanMohapatra wrote:
I have a script as follows
my $host = shift;
my $count = shift;
my $result = `ping -c $count $host`;
if($result =~ m/$count packets transmitted, $count packets received/)
{
$success = 1;
}
print $result\n;
hello experts,
I am writing one code which detect new coming mails from
server and download it to file. I am showing you the portion
of code.
1 for($l=1;$l=$msg_id;$l++)
2 {
3 my $MsgContent = $pop3-top($l, 20);
4 open (CHECK, msgtext$l.txt) || die
girish kelwalkar wrote:
hello experts,
I am writing one code which detect new coming mails from
server and download it to file. I am showing you the portion
of code.
1 for($l=1;$l=$msg_id;$l++)
2 {
3 my $MsgContent = $pop3-top($l, 20);
4 open
-Original Message-
From: Chris Devers [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 23, 2005 10:14 AM
To: TapasranjanMohapatra
Cc: Perl Beginners List
Subject: Re: printing output of ping command
On Wed, 23 Feb 2005, TapasranjanMohapatra wrote:
I have a script as
On Wed, 23 Feb 2005, Tyson Sommer wrote:
This might be a question for beginners-cgi, but since it was mentioned
here...
Sounds like it, but oh well.
This doesn't really fix your problem so much as your error handling, but
why aren't you catching the reason your script dies?
Instead of
Hi everybody,
I'm testing a simple IPC implementation that uses Linux pipes to
communicate a producer script and a consumer.
The producer script looks like:
while(1){
print Hello\n;
sleep(2);
}
And the consumer:
my @lines;
while(1){
sleep(10);
if
Hello, there!
I use PerlMagick (PM) in my work. So, I try to check is the downloaded
graphical file correct. I thought using some of PM methods (Ping ie)
could help me but no. I tried to run the script in shell and I get the
message 'html2ps not found...'. If the file is correct all is OK. eval
David Moron wrote:
Hi everybody,
I'm testing a simple IPC implementation that uses Linux pipes to
communicate a producer script and a consumer.
The producer script looks like:
while(1){
print Hello\n;
sleep(2);
}
And the consumer:
my @lines;
while(1){
The consumer has only to read lines from its STDIN and print them to the
STDOUT.
These scripts are a simplified version of the producer/consumer problem
and they try to emulate a multithreaded perl program. IMHO It's not
important what I want to do with consumer, the problem is that consumer
David Moron wrote:
The consumer has only to read lines from its STDIN and print them to
the STDOUT.
print while();
These scripts are a simplified version of the producer/consumer
problem and they try to emulate a multithreaded perl program. IMHO
It's not important what I want to do with
I need the read non-blocking of check if there's any
data ready before doing the READ.
The complete consumer is a program that reads account
packets from a radius server (this problem has been solved)
and stores the Radius attributes (MAC,IP,User_name) in a
List of Hashes. This list of hashes has
Tyson Sommer wrote:
This might be a question for beginners-cgi, but since it was mentioned
here...
I tried to use Net::Ping in a CGI script and it said I didn't have
permissions to run ping. I can execute the section of the CGI script with
the call to Net::Ping just fine from the cmd line as a
Ron Wingfield [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
snip /
Always contract for 1099 payment -- Never, never W2!
Can I ask why? I landed some telecommuting work I've been doing for about a
month now and the proprietor wants to move me to a W2...
Thanks,
Todd
--
To
What is the following telling me , especially the
chunk 2?
Use of uninitialized value in pattern match (m//) at
./lo line 27, chunk 2
I used if (defined ... to get rid of a few other
errors.
this is in reference to the following code edited to
reduce size
while (defined($in = ))
{
if (
Hi Todd,
. . .Because anyone working as a W2 employee is NOT a contractor! A W2
employee is just that, an employee. Among other things, the IRS can look (as
in an audit) at any W2 work performed in the past or future, if it is similar
to or otherwise intertwined with other 1099 services that
Hi all,
I've upgraded to Perl 5.8 from 5.6 and I'm getting output I don't understand
when I try to install the DBI module.
I'm on Solaris 9 (Sparc) and I had Perl 5.0 and 5.6 installed as packages and I
removed them with pkgrm. I then installed Perl 5.8 from ActiveState using
On Wed, 23 Feb 2005, Paul Ohashi wrote:
I've upgraded to Perl 5.8 from 5.6 and I'm getting output I don't
understand when I try to install the DBI module.
I'm on Solaris 9 (Sparc) and I had Perl 5.0 and 5.6 installed as
packages and I removed them with pkgrm. I then installed Perl 5.8
Where did you install perl?
Does your environment variables are pointing to the new perl version?.
I had the same error and I fixed changing the usual path /usr/bin/perl
to the new one /usr/local/bin/perl, just use the ln command
As long as I remember the newer versions of perl are installed
James,
If I can add my two cents worth here as well ...
I have similarly been contracting for about twenty five years, and I
will second everything that Ron wrote. Incorporate as an s-chapter
corporation - if you go in as a sole proprieter, you're personally
liable for all debts incurred,
Hello list!
I am struggling with a particular problem using Curses::UI. I am trying
to display a constantly refreshing clock in the curses interface without
much success. I've tried using a while loop instead of the mainloop()
provided by Curses::UI, and still no effect.
Here's a snippet of my
mark McWilliams wrote:
What is the following telling me , especially the
chunk 2?
Use of uninitialized value in pattern match (m//) at
./lo line 27, chunk 2
That means that the variable that is bound to the pattern match contains the
value undef. chunk 2 means that you are currently reading the
Greetings
How do I include a script in another one? For instance. I have a script called
myscript.pl and I have a second one called config.pl. config.pl contains perl
code as well, but more like only declarations and stuff. How do I now take that
and include it in myscript.pl.
Best regards
KK
Paul Ohashi [EMAIL PROTECTED] asked:
Now I'm trying to install the DBI module and when I execute
'perl Makefile.PL' the output returned says:
I see you're using perl 5.008006 on sun4-solaris, okay.
There's nothing in my environment that says perl 5.0. My
question is two fold:
31 matches
Mail list logo