i've read over push/pop/shift/unshift. is there another function which
allows you to delete an array element without leaving it as an empty
element?
thanks -charles
I am getting:
Use of uninitialized value in string eq at ./adpanel.pl line 37.
even though my line 37 appears as:
if ( $action eq "add" ) { <-- line 37
$add_alias = $formdata{alias};
$add_destination = $formdata{destination};
$add_tag = 1;
}
earlier in the script, i ha
even when defining it as my %formdata; i still get the same error. i
believe that i have tried it as
my %formdata;
my $formdata;
the only other variable reference in that line is to $action, which has a
my statement.
On Fri, 8 Jun 2001, Peter Cline wrote:
> At 09:29 AM 6/8/01 -0500, you w
ng meaningful to $action before you use it.
>
>
why is $action undefined? i use my $action; earlier in the script
and i thought that the statement $action = $formdata{action};
would take care of assigning a value to $action so that it would
not be undefined.
thanks for your time and input. -charles
i am writing a script that tests to see if an \@ symbol is entered by an
end user. i am trying to look at other alternatives that a malicious end
user might do to get around my checking. right now, i am doing a simple
if ( $add_alias =~ /\@/ ) {
could an end user enter an escaped ascii c
Sure, no problem.
i am writing a "control panel" of sorts for individuals to use to
administrate their virtual emails on a linux based sendmail server.
each client has a file in /etc/mail/include that holds tab delimited
entries for their email aliases:
[EMAIL PROTECTED] [EMAIL PROTECTED]
th
if ( $add_alias =~ /\@/ ) {
right now i am testing a variable to see if it contains an \@ character. i
would prefer to test it to see if it has anything *other* than
a-zA-Z0-9\.\-\_
can i do this with a regex like
if ( $add_alias =~ /[^a-zA-Z0-9\.\-\_]/ ) {
i am not certain if my sear
> print "You're cheating!" if($add_alias =~ /[^\w\.\-]/g); # \w Match a
> "word" character (alphanumeric plus "_")
>
wow. thanks. that looks just like what i need. however, i also
want to match the _ character as well. so will
/[^\w\.\-\_]/
work for me?
i am trying:
} elsif ( $add_destination !=~ /\@/ ) {
which is not working. i am hoping that this reads "if $add_destination
does NOT contain \@ then"
however, it apparently does not read this way :)
is my error in perl syntax or the regex?
thanks! -charles
i am running through a series of if/elsif checks on a variable:
if (($add_alias) && ($add_destination) && (!$selection)) {
if ( $add_alias =~ /[^\w\.\-]/ ) {
} elsif ( $add_destination !~ /\@/ ) {
} else {
open(FILE, ">>$filename");
print FILE "$add_alias\@$domain\t$add_
> If this is really what your code looks like, with unused blocks and all,
> it's better written as:
>
> if ( $add_alias && $add_destination && !$selection
> && $add_alias !~ /[^\w\.\-]/]
> && $add_destination !~ /\@/
> ) {
> # ... code goes here ...
> }
co routing rather than *any*
sort of programming. the Cozens book it more my speed and the
source of any code in my scripts.
thanks again! -charles
i was given the following advice concerning a large amount of html being
used within a script:
It would be cleaner to use document templates instead of
embedding the page in your code. If you put it in your code,
it'd be clearer to use shell-style HERE documents than so many
multiline print state
is there a flag that will test to see if a file is a symlink? i am only
finding tests for directory, perms and such.
thanks
-charles
to sum it up, i am reading /etc/group, taking the list of users from three
groups (listed in @domains) and then matching each of the users to their
entry in /etc/passwd and printing the line to a file that has the name of
their group.
as it stands, this script only manages to write the passwd in
ere a reason why this same script can't do both jobs?
thanks!! -charles
the script:
#!/usr/bin/perl -w
# $Id: mkmail.pl,v 1.16 2001/07/01 18:48:40 root Exp $
use strict;
#definitions and declarations
my $each;
my $inc = "/etc/mail/include";
my $vtmp = "/etc/mail/.virtusertab
it doesnt seem to be
splitting a line on the \t character, rather it just feeds me the entire
line back as $entry[0].
when i open my file in vim, i confirm that each line is indeed tab
delimited. do i have an error in my syntax?
thanks -charles
mr. cozens seems to have been speaking directly to me when he wrote 'one
thing novice programmers want to do is construct a variable whose name is
generated from the contents of another variable.'
that is exactly what i am doing in the attached script, creating an array
name from a value being pul
Here is my new code, and unfortunately, use strict; which i refuse to give
up is giving me one complaint. it seems pretty straight forward, but i am
not certain what do to about it.
The error:
Use of implicit split to @_ is deprecated at /root/bin/panelpasswd.pl line
19.
The code:
for $one(@doma
sorry, but the script has two complaints. i apologize for the additional
post.
Use of implicit split to @_ is deprecated at /root/bin/panelpasswd.pl line
26.
Can't use string ("2") as an ARRAY ref while "strict refs" in use at
/root/bin/panelpasswd.pl line 26, chunk 39.
i am not sure where its
s build upon it.
-charles
On Tue, 3 Jul 2001, Tarik Jeait wrote:
> Hi,
> can somebody tell me how to change my unix passwd by a perl script
> :
>
> open(FILE,"|passwd"); --> doesn't work ;
>
> must I open some pipe or What ?
>
> T.J
>
> Thank you
>
>
i'd like to define a new line separator as a simple blank line. i have
tried \n\n and even tried ^$ in the way of a regex, but to no avail. is
there a metacharacter specific to this?
-cjm
I've read through
http://search.cpan.org/doc/JHI/perl-5.7.1/lib/Getopt/Std.pm
and it seems as though the following syntax should work:
getopt("nh",\%option);
however, it does not. when i use getopts rather than getopt
getopts("nh",\%option);
it does work. did i misread the cpan page that i re
my script is as follows:
#!/usr/bin/perl -w
use strict;
my $domain;
my $path;
my %option;
getopts("nhfc",\%option);
i have 4 options set.
typically two will be used together n and f, however i am sure that end
users will type in 'script -fn' and 'script -nf'. my concern is that each
of these
yes, sorry, i am using use Getopt::Std; in my code as well. sorry that i
forgot to include that in the code, however it is there in the script.
On Wed, 4 Jul 2001, Pierre Smolarek wrote:
> use Getopt::Std;
>
> ?
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: "Perl Discuss" <
argument or 1 if no argument is
specified
so it seems as though my arguments are not getting passed for
some reason.
here is my code, in its entirety. i've removed some flag options
for more concise reading and testing
thanks! -charles
#!/usr/
#!/usr/bin/perl -w
use strict;
my $dir = "cody";
mkdir("$dir",0770);
i am running this in my home directory on a linux machine, so i have full
rights. when i run this however, the permissions on the directory are:
drwxr-x---2 cmenzes cmenzes 1024 Jul 7 10:39 cody/
which translates
>
> This will tell you why or how something might be going wrong and what your
> pwd is. Also, you should check the parent directory in which you are
> trying to make this directory for directory permissions (seteuid) which can
> cause the directory to be created the same as the parent directory.
I think someone on the list said it best when they wrote "what have you
got so far and lets build from there."
On Mon, 9 Jul 2001, Tito Perez wrote:
> Hi all, I want to write a script that generates a web
> page based on the contents of a directory.
> What is a simple way to iterate through th
after the
while statement in order for this print to work? and if so, why is it
automagically being closed?
thanks -charles
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ed experience with modules or creating objects using $scalar = new so
a simple mistake could be lurking
your advice is appreciated, -charles
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
a friend pointed out that i was only using the single colon in my use
statement, so i suppose my issue could be considered resolved. can someone
explain the statement on deprecated syntax however?
should i be seeing this? and what can i do to quiet this down?
thanks -charles
On Fri, 20 Jul
only module I see that suits my tab is
http://search.cpan.org/search?dist=Text-Tabs+Wrap
but i get an error saying that the package is no longer available. Is
there another package available for my platform that i am missing?
thanks -charles
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
i have:
my $version = '$Revision: 1.47 $';
$rcs =~ s/[^\d.]+//;
looking at the regex match, i would think this should match all
non-numeric and \. characters. however, the value of $rcs ends up as:
1.47 $
i am not sure why the \s and \$ after the numbers are not being wiped out.
thanks -c
-
my code:
#!/usr/bin/perl -w
use strict;
my $info;
my $file;
opendir(DIR, "/etc/") or die "Can't open directory : $!\n";
my @list = readdir(DIR);
for $file(@list) {
next if ( -d $file );
$info = (stat($file))[7];
print "Filename: $file : $info\n";
}
closedir(DIR);
I am getting:
I am using File::Copy and I think I am either misreading the CPAN doc or
missing
something in my code. When I am copying files, ownership and permissions
do not
remain intact, but rather take on the ownership and permissions of the
user running the
script.
The docs talk about syscopy but s
really looking for the answer as to whether
or not my situation merits
system('cp -p /foo.txt /bar.txt');
or if this is something that can be done with File::Copy.
thanks! -charles
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I am getting:
Use of uninitialized value at /root/bin/ref.pl line 152.
A snippet of my code is:
chdir("$www") or die "Cant change directory to /www.\n";
my @webhost = glob("*");
chdir("$dir") or die "Cant change directory to the control panel.\n";
my @controlpanel = glob("*");
if ($htaccess)
yep. my bad. all of my issues came through buying back issues, so i never
even bothered to look at the dates.
On Fri, 6 Jul 2001, Tim Musson wrote:
> Hey Chas,
>
> Friday, July 06, 2001, 4:24:27 PM, my MUA believes you used
> Evolution/0.10.99 (Preview Release) to write:
>
> CO> On 06 Jul 2001
I hate to be the bearer of possibly bad news, but the Perl Journal will
not be returning as a full fledged monthly magazine. I was told today by
cmp that it will only be released as a quarterly supplement to subscribers
of sysadmin.
Granted, I enjoy the thought that it is at least available, but
t;;
}
within my code. it works like a charm. however, when i try:
sub header {
print << head;
Content-type: text/html\n\n
Control Panel
head
}
is this not working because of a fault in my syntax? or is this not
possible within perl?
thanks! -charles
that a foreach
statement can be written up to do what i am asking. my question is more
concerning good etiquette and what i should expect to see in other
scripts, or what others would expect to see in mine should i distribute
them through the web.
thanks! -charles
e think that something is incorrect in my if
test. the form itself does not have anything default value specified for
view_name.
finally, my questions are starting to deal with perl used within cgi. i'm
a (brand) newbie to perl. should these questions go to beginners@ or
cgi-list@
thanks!!
-charles
so, how can i "touch" an
array so that i can push stuff into it?
thanks! -charles
each line of the file become its
own element? for some reason, i don't think i am getting the data into the
array that i think i am putting there :)
thanks -charles
lines from
$filename to be written to $tmpfile. can someone point out my error?
sorry for so many questions. its my first day with perl.
thanks for everyone's help! -charles
I have a peculiar problem coming up with a command i am issueing through
net::snmp
When I issue the following command using snmpset from a unix shell, the
remote host responds correctly:
snmpset -c private router .1.3.6.1.4.1.9.9.96.1.1.1.1.14.667 i 4
however, the same command issued through a
ing set to true
since the $checkport will always at least attempt a connection.
maybe my reasoning to that is incorrect, but i guess, that is why i am
writing :) any help is appreciated. thanks -charles
#!/usr/bin/perl -w
use strict;
use IO::Socket;
my $remoteip = "10.6.21.10";
my $port
t attempt a connection.
> >
> > maybe my reasoning to that is incorrect, but i guess, that is
> > why i am
> > writing :) any help is appreciated. thanks -charles
>
> connect() on a SOCK_DGRAM (UDP) socket doesn't really "do" anything;
> it jus
ning. i was hoping to put
in a test that could check to see if the port is listening, so
the script could exit if it is not.
thanks for your input. i appreciate it. -charles
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
hello all,
i am thinking of adding the ability to fork into a script i've written
recently. the script acts on a list of nodes. currently it does this, one
at a time, which could prove to be a lengthy process for longer lists.
i was thinking that fork would allow me to spawn child pids and spee
If you are just looking to see if X from file one is in file two, and vice
versa, you may want to look at p147 in the Cookbook. It's example is
comparing the hash keys of two seperate hashes.
If you place each line of your file into a hash and the other file in
another hash, and compare the to
hello all, i'm having some issues with subroutines being ran on a forked
process. the subroutines have print statements which i would like to have
printed to stdout in a format similar to:
"\nthis is my message\n\n"
however, the print format is not as controlled as it is when i do not
fork. s
i've gotten to be somewhat comfortable using net::snmp. at the very least
i've used its get_request and set_request methods. however an oid used by
cisco seems to need to be called using 'snmpwalk' rather than a get or set
request. net::snmp has a get_next_request and a get_table, but i'm
conf
Help
Three days of head-banging the Boss has my walking papers if I
don't "get'er done"!
I have module from CPAN named Graph. I have created a subroutine for
this to pass in two arrays; x-axis and y-axis into my Graph subroutine
i.e. ; &graph( @Xvalues, @Yvalues );
My confusions is: in
On Nov 1, 1:37 pm, [EMAIL PROTECTED] (Jl Post) wrote:
> On Nov 1, 9:35 am, [EMAIL PROTECTED] (Charles) wrote:
>
>
>
> > I have module from CPAN named Graph. I have created a subroutine for
> > this to pass in two arrays; x-axis and y-axis into my Graph subroutine
>
ow do we deal with calling subroutines within a
subroutine in terms of sharing variables?
any suggestions?
Charles
_
Get your FREE download of MSN Explorer at http://explorer.msn.com
If you want to write a subroutine that write the output to a text file you
can do this:
open FILE ">temp.txt" or die;
&function_one (\*FILE);
sub function_one{
my $fh = shift;
print $fh "blah blah blah\n";
}
OR you can do this:
&function_one("temp.txt");
sub function_one{
my $fi
Functions like pop(), push() allow you to add or remove one element to or
from a list. Is there a function that allows you to add or remove "X"
number of elements where "X" > 1?
_
Get your FREE download of MSN Explorer at http://ex
Lets say I want my program to print to STDOUT unless the user
specifies that the output goes to a file. Here is my code:
my $oldhandle=undef;
if($user_input ne 'STDOUT') { #user specify output to a file
open (OUT,">$temp.txt") or die "Can't open the file\n";
$oldhandle =
The following snippet of code doesn't behave the way I want it to. Yet i
cannot see why?
$hash{s} = "T";
if(exists($hash{s}) and $hash{s} ne "T" or $hash{s} ne "F") {
print "inside\n";
}
else{ print "outside\n"; }
the OUTPUT of this program prints "inside". But I want it to go
How do I direct the messages destined for STDERR and redirect them to
STDOUT?
I have a perl script A that calls another program B. If there is bad input,
Program B dumps out a lot of error messages through STDERR. I want to be
able to stop my perl script when it detects messages coming fro
When you run a perl script from command line, you can often retrieve the
arguments through the special variable @ARGV.
If you type the following:
perl myscript.pl input.txt output.txt
on a commandline, the value of $ARGV[0] will be input.txt,
$ARGV[1] will be output.txt.
My question is is th
someone must have
written a function for it. Can anyone suggest a module/builtin function
that takes a number and checks to see it that number already exists in an
array? basically a "is_in()" function that returns true or false.
thanks a lo
Does anyone know if there is a built in function that allows you to check to
see if all the characters in a string is capitalized or not? In other words
is there a way to check to see if a string is capitalized without using
regular expression? Thanks alot
charles
o
be searched.
I am brand new to this, yet I a already have a need to replace
area codes on a list. Your help is apreciated.
Mike Charles
*
s 3* *
4* *
| 5* *
v 6* *
7
8
9
10
is it then possible to reposition the
cursor and print a value at row 4 column 10?
Thank you for any help.
Charles
--
To unsubscribe, e-mail: [EM
I'm trying to install UR-v0.12 - and encountered a great wizard. But I don't
have root access on my machine. I get
You are not allowed to write to the directory '/usr/lib/perl5/site_perl/5.8.8'
even though I'd entered
Your choice: [] PREFIX=~/lib/perl
Can somebody please explain to me
Hello,
I subscribed to perl.beginners via Google groups but none of my posts
get through
Can you help or suggest what might be amiss?
--
Charles DeRykus
Hi
If i want to compare 2 values in scientific notation i.e.
1.2e-400 4.3e-200
I cannot use simply use "< , > " operator. For some reason,
0 > 1e-400.
Is there a module I can use?
thanks
Charles
_
Get
I need to look at a directory for about 90 seconds, and if a certain
file shows up, do something with it. A pointer to a man page or any
reference would be appreciated.
--charlie
--
Charles Farinella
Appropriate Solutions, Inc.
603-924-6079
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
7;t work.
--charlie
--
Charles Farinella
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
603.924.6079
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Im trying to make a script that will login to my Pitas blog and then
post an entry. I seem to be having problems with the cookies. The
script is:
#!/usr/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use HTTP::Cookies;
#Get needed info
print 'Login: ';
$uname = ;
print 'Passw
Im trying to make a script that will login to my Pitas blog and then
post an entry. I seem to be having problems with the cookies. The
script is:
#!/usr/bin/perl
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use HTTP::Cookies;
#Get needed info
print 'Login: ';
$uname = ;
print 'Passw
How can I iterate through an array and if I find a match do something
without doing that thing for every element in the array. I've been
trying to do it with foreach, but that isn't working.
--
--------
Charles
e webforms for our customers and we're getting spammed. I'd like
to put all the phrases into an array instead of all of this 'or' business.
On 10/10/06, Charles Farinella <[EMAIL PROTECTED]> wrote:
How can I iterate through an array and if I find a match do somet
#x27;s just what I'm looking for, thanks so much. :-)
Hope this helps!
--Tom Phoenix
Stonehenge Perl Training
--
----
Charles Farinella
Appropriate Solutions, Inc. (www.AppropriateSolutions.com)
[EMAIL PROTECTED]
vo
30];
#
HERE IS MY CODE (IT DOESN'T WORK)
sub by_third_item {
return $query->{$reference}->[$a][2] <=> $query->{$reference}->[$b][2];
}
@sortedlist = sort by_third_i
onsecutive fashion?
(1,2,2,2,3) = True;(1,2,2,3,4,2) = False
(1,2,2,3,4,2,2,) = False <-- consecutive but appears more than once
(1,2,3,4,5,2,2,2,2,2) = False ( see previous reason)
(1,2,3,4) = true <--- appearing only once is okay
I would appreciate any help with this problem. thank
Hi
Does anyone know if there is a build in function or module that would
allow me to write a piece of code and have it executed after a certain time?
In other words, if I want some function to run exactly 3 minutes after a
previous function, how can I specify that in perl?
thanks very
Hi,
I'm experimenting with Math::Trig and would like to be able to pass the
function in as a parameter:
$f = $opts{f} || &sin;
...
&$f($w);
Undefined subroutine &main::sin called at (eval
9)[/usr/lib/perl5/5.14.2/perl5db.pl:640] line 2.
I have also tried:
$f = &Math::Trig::sin;
Hello Shawn, thank you for answering.
I'm sorry, I was a bit sloppy with my example and so maybe unclear about my
question ...
It's not about the precise syntax of getting a reference to a subroutine, but
rather a subroutine in a module.
For example, this pgm is clear:
#!/usr/bin/env perl
sub
thank you.
cts
--- On Sat, 6/23/12, Ron Bergin wrote:
> From: Ron Bergin
> Subject: Re: how to do a reference to a func in Math::Trig
> To: "Charles Smith"
> Cc: beginners@perl.org
> Date: Saturday, June 23, 2012, 3:28 PM
> Charles Smith wrote:
>
> [snip]
Thank you. The useful note about CORE, in particular, is new to me.
cts
--- On Sun, 6/24/12, Rob Dixon wrote:
> From: Rob Dixon
> Subject: Re: how to do a reference to a func in Math::Trig
> To: "Perl Beginners"
> Cc: "Charles Smith"
> Date: Sunday, June
looks correct.
I have modified the Mechanize.pm @ line no. 2042 to open( my $fh,
'>:utf8', $filename ). But I am not getting the desired output.
Please help in getting the $mech->content in utf-8 format.
Try $mech->decoded_content instead of $mech->content.
HTH,
C
ter
> use CGI;
Or, just:
binmode STDIN, ":crlf";
This is Perl's layer to implement DOS/Windows like CRLF line endings.
See: perldoc perlio
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
=> 10.00.00.00.aa.5a.9b.63
Assuming no anomalies/surprises in file.txt:
use File::Slurp;
use strict;
use warnings;
my @lines = read_file( 'file.txt', chomp=>1 );
my %hash = map { split( /\s*=>\s*/,$_ ) } @lines;
--
Charles DeRykus
--
To unsubscribe, e-mail: beginne
=> 10.00.00.00.aa.5a.9b.63
>
> How do i build all the entries into hash including the duplicates on both
> sides keys and values.
One possible way:
DB_File has a BTREE file type (with the R_DUP setting and
the 'seq' API method) that enables storing/retrieving dup's.
There
I would rather I did not get the first two lines of output.
> Is there a way to accomplish this and still have warnings turned on?
> (I understand that the first line is a consequence of my system
> command to turn on UTF-8.)
>
>
binmode STDOUT, ":utf8";
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Thu, Nov 29, 2012 at 5:00 AM, timothy adigun <2teezp...@gmail.com> wrote:
> Hi,
> Please check my comments below:
>
> On Thu, Nov 29, 2012 at 8:55 AM, Charles DeRykus wrote:
>>
>> On Wed, Nov 28, 2012 at 8:10 PM, boB Stepp wrote:
>> > As I have mentioned
erent to do, there is
> no way to permanently change the default behavior of the command
> prompt on my system. Is it clear what I am actually asking?
>
> One thing you add above, "use strict;": I have not reached this in my
> book yet. Is this something you would recommend me to add to my
> scripts routinely?
>
Yes, 'use strict;' has been a best practice for some time.
See: perldoc perlstyle
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
On Sat, Dec 1, 2012 at 9:58 PM, Charles DeRykus wrote:
> ...
>
> On the command line, I believe you just redirecto to nul:
>
> chch 2>nul
^^^
chcp
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubs
On Sat, Dec 1, 2012 at 10:06 PM, boB Stepp wrote:
> On Sat, Dec 1, 2012 at 11:58 PM, Charles DeRykus wrote:
>> On Sat, Dec 1, 2012 at 8:50 PM, boB Stepp wrote:
>>>
>>> What I would like to do is make chcp 65001 the default behavior of the
>>> command consol
On Thu, Dec 13, 2012 at 8:09 AM, Alvin Ramos wrote:
> Any one have any suggestions of a module/function/method to write a perl
> script to try pinging a server then after the 3rd time to send an email?
> Thanks in advance...
perldoc Net::Ping
--
Charles DeRykus
--
To unsubscrib
supp...@dnsbed.com
That's closer to what you want... one solution to the unwanted \
would be $user =~ tr/\\//d;
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
itution
It may be a good sanity check to do so though if you're always
expecting the substitution to succeed. Otherwise,
even though the eval works, a failed pattern match will
fail silently. But you could still report failure by checking
the substitution return:
s/.../../ or carp "pattern failed";
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
quot;:utf8");
$cosa = "my \x{263a}";
print "cosa=$cosa\n";
print "found smiley at \\b\n" if $cosa =~ /\b\x{263a}/;
print "found smiley (no \\b)" if $cosa =~ /\x{263a}/;
The output:
cosa=my ☺
found smiley (no \b)
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
reinventing the wheel, one bug at a time :-).
> What does the experienced Perl programmer - or socket-level programmer in
> general - do in this situation?
>
I'm not experienced in heavy duty socket-level programming
but you may want to invest in learning POE:
https://poe.pe
On Sat, Jan 12, 2013 at 12:56 PM, Charles DeRykus wrote:
> On Fri, Jan 11, 2013 at 2:01 PM, Christer Palm wrote:
>> Hi!
>>
>> I have a perl script that parses RSS streams from different news sources and
>> experience problems with national characters in a regexp funct
ma separated emails.
See: perldoc URI.
my $uri = URI->new($link);
if ( $uri->scheme eq 'mailto') {
my $email = $uri->path;
...
}
--
Charles DeRykus
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
1 - 100 of 880 matches
Mail list logo