by whitespace, not necessarily a single space.
Try passing the pattern '\w+' to split. Something like this:
#!/usr/bin/perl
use strict;
use warnings;
open (LS, "w|") or die "can't open w: $!";
;
;
while () {
print ((split)[4], "\n");
}
Stephen Kratzer
Network Engineer
CTI Networks, Inc.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Thursday 10 July 2008 10:33:31 Jay Savage wrote:
> On Thu, Jul 10, 2008 at 8:48 AM, Stephen Kratzer <[EMAIL PROTECTED]> wrote:
> > Anirban,
> >
> > The output of 'w' is delimited by whitespace, not necessarily a single
> > space. Try passing the
On Tuesday 05 June 2007 09:38:51 Xu, Lizhe wrote:
> Hi All,
> =20
> The example given for splice function in the perldoc shows
> sub aeq {
> ...
> my(@a)=3D splice (@_, 0, shift);
> ...
> }
> I am confused about what the splice command does with the shift command =
> and what the result of the c
On Wednesday 11 July 2007 07:31:30 Octavian Rasnita wrote:
> Hi,
>
> I am trying to install DBD::mysql and I see that it tries to connect to the
> server using the socket
> /var/lib/mysql/mysql.sock
>
> This is because another version of MySQL was installed on the server, and I
> have installed ano
On Friday 24 August 2007 08:57:26 Marian Bednar wrote:
> Hi all,
>
>
> I am a newbie in this forum and Perl too ;-)
>
> I am trying writing script transfering files using module
> Net::SFTP::Foreign.
>
> I need to retrieve from remote directory only names of files (not
> directories, links,etc.).
>
On Friday 24 August 2007 21:00:37 John W. Krahn wrote:
> Stephen Kratzer wrote:
> > On Friday 24 August 2007 08:57:26 Marian Bednar wrote:
> >> I am a newbie in this forum and Perl too ;-)
> >>
> >> I am trying writing script transfering files using module
>
On Monday 27 August 2007 12:36:02 country wrote:
> s2pe,CTI Production ,8455,21.7%
> sybprd01,OMS,5326,13.7%
> pctip01,CTI,5098,13.1%
> lxsadr54,CTI,1742,4.5%
> pipmp01,SSG-IPM,1742,4.5%
> maestro,SSG-RAC-Maestro ,1020,2.6%
> f2pa,"DB2DARI ""stored procedures"" prod",836,2.1%
> pomgp01,SSG-PMD-Ome
On Wednesday 29 August 2007 00:43:52 [EMAIL PROTECTED] wrote:
> Hi,
>
> Please find below my code to compare 2 files
> "source.txt,destination.txt" in folder "seek"
>
> #!perl
>
> use File::Compare;
>
> if(Compare("source.txt","destination.txt")==0)
> {
> print "They're equal\n";
>
On Friday 19 October 2007 07:41:40 Beginner wrote:
> Hi,
>
> In the script below I am trying my hand at using a code ref within a
> hash. I want the key 'name' to contain a scalar value. It does but I
> am not sure how to dereference it.
>
> Here is the output from the script at the moment.
>
> /da
t a typo, but "$my file" should be "my $file". Most
importantly, the program is more complicated than it needs to be. A more
concise and readable example might be something like:
#!/usr/bin/perl
open SUBSET1, ">", "subset1" or die "Cannot ope
erator produces an assignable result, using assignments
without parentheses will get you in trouble. For example, this:
$a % 2 ? $a += 10 : $a += 2
Really means this:
(($a % 2) ? ($a += 10) : $a) += 2
Rather than this:
($a % 2) ? ($a += 10) :
On Thursday 17 January 2008 09:16:17 [EMAIL PROTECTED] wrote:
> Hi All,
>
>
>
> I am executing following command in Perl script
>
>
>
> $vw=system("mk_view $view_name ETC");
>
> if ($vw)
>
> { print "view created successfully\n";
>
> }
>
>
>
> When I run this command, I am getting message "view c
point which is
activated only when the associated condition is true. To add a watchpoint,
type 'w expr' in the debugger where expr is the expression which must be true
in order for the watchpoint to be activated. In your case, type 'w $i == 10'.
Stephen Kratzer
Network Engineer
On Monday 05 May 2008 09:22:51 Rodrigo Tavares wrote:
> Hello,
>
> I need create a square using a single number, but I don't know how to
> create the sides.
>
> I have to create this:
>
>
> * *
> * *
>
>
> My code is below :
>
> print "Enter with number:";
> chomp ($number = );
>
> my @
I'm not too familiar with threads, but I'll give it a go. You're still
executing the download() sub seventy times one after another rather than
concurrently. The async function will created one new thread for the block
following it. You might try a for loop which creates a new thread at each
it
k and device
monitoring tools, so there's really no reason for you to try to reinvent the
wheel in two hours.
Stephen Kratzer
CTI Networks, Inc.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://l
broutine;
}
}
sub timer_test {
print "Testing...\n"
}
You'd need to modify the timer subroutine in order to pass arguments to the
routine executed by it.
Stephen Kratzer
CTI Networks, Inc.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On Friday 21 July 2006 08:59, Sayed, Irfan (Irfan) wrote:
> Hi,
>
> I am executing following code.
>
> foreach (@vob_repl_list)
>
> {
>
> print $_;
>
> `$MT chreplica -host puvob02 $_`;
>
> }
>
> but I am not getting the value of $_ in the command `$MT chreplica -host
> puvob02 $_`; if I print the
On Friday 21 July 2006 12:24, Jerry DuVal wrote:
> Any way to catch a die message? I want to catch a die message from a sub
> routine, log it, and continue with a different sub routine.
>
>
>
> Thanks in advance,
>
>
>
> Jerry
You could call the subroutine from an eval block and check the value of
Chances are that the file size will never equal exactly 500 bytes. You could
use >= instead of eq, and it should work. Also, you don't have to close
STDERR before reopening it, and in cases where you want to do numeric
comparisons, use == instead of eq. Hope that helps a little. Also, it might
Opening the filehandle STDERR to a file will not persist beyond termination of
the script, nor will it affect other programs running at the same time as the
script. It affects only the running script. STDERR of the shell is different
from that of perl.
On Friday 07 October 2005 16:56, Timothy J
Mazhar,
try:
$telnet->waitfor(Match => '/login: $/i');
and
$telnet->waitfor(Match => '/password: $/i');
Vishal,
Right, you want to wait for the device to return something that will match the
expression between the slashes. In that example, you'd be waiting for the
device to return a login prom
Your regexes are probably not doing what you expect them to. You're using
character classes, so it's waiting for the device to return a one character
prompt that matches any one of the characters from the class. Try something
like /password[: ]*$/i and something similar for other prompts.
> All
23 matches
Mail list logo