5.14.0;
my @alarm = (xyz, abc);
my $name = ab;
unless (grep {/\b$name\b/} @alarm) { print Not in array!\n }
--
Peter Gordon, pete...@netspace.net.au on 02/21/2014
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http
, abc);
my $name = ab;
my $name1 = abc;
# Check ab.
unless ( grep { /$name/ } @alarm ) {
say $name not found;
} else {
say $name found;
}
# Check abc.
unless ( grep { /$name1/ } @alarm ) {
say $name1 not found;
} else {
say $name1 found;
}
[OUTPUT]
ab found
abc found
--
Peter Gordon, pete
On Thu, 9 Jan 2014 09:55:45 +, Gary Stainburn wrote:
On Thursday 09 January 2014 09:53:35 Gary Stainburn wrote:
Oops, Missed a bit, try
s/^[0-9]+[a-c]{0,1}[-_]//;
Ringways Garages
http://www.ringways.co.uk
Yes, this works is probably more efficient than my RE.
Thanks
--
Peter Gordon
])*(?:[-_])?(.*)/$1/;
}
say $oldname\t\t$newname;
}
--
Peter Gordon, pete...@netspace.net.au on 01/09/2014
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Thu, 9 Jan 2014 10:57:00 GMT, Peter Gordon wrote:
I'm trying do write a one line RE to strip sequence numbers off
filenames. The filename can may have:
No sequence numbers
or
Start with a variable number of digits,
Followed by an optional character between a and c
Followed by a compulsory
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
My attempt:
#! /usr/bin/perl -w
use 5.14.0;
use strict;
while( ) {
if ( /(?:.*?)(\w+ \d+, \d+) at .*p$/ ) {
print $1\n;
}
}
--
Peter Gordon, pete...@netspace.net.au on 11/26/2013
--
To unsubscribe, e-mail: beginners-unsubscr
On 11/18/2013 10:45 AM, Juan Wei wrote:
I have the Cywin version of perl installed on a Windows 7
computer, and it does not have a perldoc executable.
How can I get perldoc functionality?
Open a bash window type perldoc -h
This should give you the documentation on perldoc.
--
Peter Gordon
On Mon, 18 Nov 2013 00:35:17 -0500, Peter Holsberg wrote:
Peter Gordon pete...@netspace.net.au wrote:
On 11/18/2013 10:45 AM, Juan Wei wrote:
I have the Cywin version of perl installed on a Windows 7
computer, and it does not have a perldoc executable.
How can I get perldoc functionality?
Open
5.12.0;
automatically turns on use strict; ?
--
Peter Gordon, pete...@netspace.net.au on 08/06/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
name at ./t line 4.
# Execution of ./t aborted due to compilation errors.
--
Peter Gordon, pete...@netspace.net.au on 08/06/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
to compilation errors.
#!/usr/bin/perl
use 5.12.0;
$var = Avalue;
# Output
# Global symbol $var requires explicit package name at ./t line 4.
# Execution of ./t aborted due to compilation errors.
--
Peter Gordon, pete...@netspace.net.au on 08/06/2013
--
To unsubscribe, e-mail: beginners-unsubscr
it there so you can use the same concept if you are going to
save the string.
my $str = join (map [$_], @fruits);
say $str;
This code outputs a blank line I can't see how to produce
a string of the required output using join map. Anybody
have an answer?
Thanks
--
Peter Gordon, pete
realised that the ''
after join are two single quotes and not one double quote.
--
Peter Gordon, pete...@netspace.net.au on 08/04/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
http://preview.tinyurl.com/c2h35h6
(You can control the directories which are in @INC)
--
Peter Gordon, pete...@netspace.net.au on 07/26/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
have a file with mixed encodings, you have my sympathies.
--
Peter Gordon, pete...@netspace.net.au on 06/26/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
http://www.tizag.com/perlT/perlhashes.php
particularly the section on sort by keys by values.
This should give you a good understanding of the
how to use them.
--
Peter Gordon, pete...@netspace.net.au on 06/16/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands
On Sun, 19 May 2013 09:16:33 -0700, John SJ Anderson wrote:
Our FAQ has a list of recommended resources: http://www.perl.org/learn/faq/beginners.html#books
Heck, that list is dated. Learning Perl is now in it's 6 th edition.
--
Peter Gordon, pete...@netspace.net.au on 05/20/2013
--
Peter Gordon, pete...@netspace.net.au on 05/17/2013
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
18 matches
Mail list logo