[27507] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 9092 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 26 11:05:51 2006

Date: Sun, 26 Mar 2006 08:05:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 26 Mar 2006     Volume: 10 Number: 9092

Today's topics:
        can't create symbolic references <rallabs@adelphia.net>
    Re: can't create symbolic references <matthew.garrish@sympatico.ca>
    Re: file renamer... request feedback <rwxr-xr-x@gmx.de>
        previous post had no color change <rallabs@adelphia.net>
    Re: previous post had no color change <1usa@llenroc.ude.invalid>
    Re: previous post had no color change <matthew.garrish@sympatico.ca>
    Re: short form for (defined $x and defined $y and ... ) (Anno Siegel)
    Re: sockaddr_in() timeout or asynchone call ? <rwxr-xr-x@gmx.de>
    Re: Source Code release from Vendor <matthew.garrish@sympatico.ca>
    Re: Source Code release from Vendor <tadmc@augustmail.com>
    Re: XML::Simple and utf8 woes <dlking@cpan.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 26 Mar 2006 09:02:09 -0500
From: "mike" <rallabs@adelphia.net>
Subject: can't create symbolic references
Message-Id: <wPqdnZrV2sB-A7vZnZ2dnUVZ_uWdnZ2d@adelphia.com>

Can anyone tell me why the following script gives an error message stating 
'use of uninitialized value in concatenation or string at line 20'?:

#!/usr/bin/perl -wT
#This is a.cgi, called by woxYNzucw.cgi
use strict;
no strict "refs";
use CGI::Carp qw(fatalsToBrowser);
use CGI qw(:standard -no_xhtml);
use diagnostics;
my $co = new CGI;
print $co->header;
my @atoms = qw ();
print $co->start_html(-title=>'ref');
my $var=5;
my $refv=\$var;
print $co->h2("var = $var; dereferenced hard ref = $$refv");
my $varr=6;
my $varref="varr";
my $vv=$$varref;
print $co->h2("dereferenced varr is $vv");

With output:
var = 5; dereferenced hard ref = 5
dereferenced varr is

Thank you for any help.  (I'm not sure why the color change)




------------------------------

Date: Sun, 26 Mar 2006 09:25:39 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: can't create symbolic references
Message-Id: <BvxVf.121$m35.5225@news20.bellglobal.com>


"mike" <rallabs@adelphia.net> wrote in message 
news:wPqdnZrV2sB-A7vZnZ2dnUVZ_uWdnZ2d@adelphia.com...
> Can anyone tell me why the following script gives an error message stating 
> 'use of uninitialized value in concatenation or string at line 20'?:
>

There aren't twenty lines in the code you posted.

> #!/usr/bin/perl -wT
> #This is a.cgi, called by woxYNzucw.cgi
> use strict;
> no strict "refs";
> use CGI::Carp qw(fatalsToBrowser);
> use CGI qw(:standard -no_xhtml);
> use diagnostics;
> my $co = new CGI;
> print $co->header;
> my @atoms = qw ();
> print $co->start_html(-title=>'ref');
> my $var=5;
> my $refv=\$var;
> print $co->h2("var = $var; dereferenced hard ref = $$refv");
> my $varr=6;
> my $varref="varr";
> my $vv=$$varref;
> print $co->h2("dereferenced varr is $vv");
>
> With output:
> var = 5; dereferenced hard ref = 5
> dereferenced varr is
>

You can't use symbolic references with lexically scoped variables (see the 
"Symbolic references" section in perlref).

Why do you need them, though? As said many times in the past, a hash is 
almost always a better option to symrefs.

Matt 




------------------------------

Date: Sun, 26 Mar 2006 16:58:33 +0200
From: "Lukas Mai" <rwxr-xr-x@gmx.de>
Subject: Re: file renamer... request feedback
Message-Id: <e06a6o$ubd$01$3@news.t-online.com>

robic0 schrob:
> 
> Uri, $new =~ s/^_//g; re-anchors after the substitution, minus 1 '_'.

No, it doesn't. Uri is right. You are completely wrong and I have no
idea why you think /g changes how anchors work.

> You hate me and thats ok man. There isin't anybody I haven't insulted

I don't hate you, I hate obviously incorrect postings ("obviously"
because the docs say something else and a one-line test script would
show the docs to be right).

> on this group, and your probably one of them. I'm not saying thats right,
> but the knowledge moves faster when the adrenaline flows. I like to cover
> all the bases, from trivial to breaking down complexity.

Content free.

> I kick back when I'm kicked...

Less kicking, more reading plz. Remember, I pwn your soul.

Thanks, Lukas


------------------------------

Date: Sun, 26 Mar 2006 09:08:57 -0500
From: "mike" <rallabs@adelphia.net>
Subject: previous post had no color change
Message-Id: <6vadneDqBbDnPbvZRVn-tA@adelphia.com>

To everyone who read my last post, my last line said "I'm not sure why the 
color change", referring to a color change on my screen from black to red 
near the end of the post.  I looked at the post, and the color change was 
not there, so it must have been local to my setup of O.E.
Mike




------------------------------

Date: Sun, 26 Mar 2006 14:24:02 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: previous post had no color change
Message-Id: <Xns97925FC0A5254asu1cornelledu@127.0.0.1>

"mike" <rallabs@adelphia.net> wrote in
news:6vadneDqBbDnPbvZRVn-tA@adelphia.com: 

> To everyone who read my last post, my last line said "I'm not sure why
> the color change", referring to a color change on my screen from black
> to red near the end of the post.  I looked at the post, and the color
> change was not there, so it must have been local to my setup of O.E.

What are you talking about? Couldn't you at least have replied in the same 
thread as your OP?

Even if the color of something on your computer's screen changed, what 
does that have to do with Perl?

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html



------------------------------

Date: Sun, 26 Mar 2006 09:31:11 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: previous post had no color change
Message-Id: <MAxVf.138$m35.5399@news20.bellglobal.com>


"mike" <rallabs@adelphia.net> wrote in message 
news:6vadneDqBbDnPbvZRVn-tA@adelphia.com...
> To everyone who read my last post, my last line said "I'm not sure why the 
> color change", referring to a color change on my screen from black to red 
> near the end of the post.  I looked at the post, and the color change was 
> not there, so it must have been local to my setup of O.E.
>

If you need to post a followup, please don't create a new thread.

That said, plain text is the generally accepted medium for posting, so if 
you're tempted to send a nice html formatted message, don't. OE may show 
colour if you copy and paste from an html page, but the default setting is 
to send text so that formatting will be dropped when you send the message.

Matt 




------------------------------

Date: 26 Mar 2006 13:28:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: short form for (defined $x and defined $y and ... )?
Message-Id: <48nj7lFl40a2U1@news.dfncis.de>

Joe Smith  <joe@inwap.com> wrote in comp.lang.perl.misc:
> Markus Dehmann wrote:
> 
> > my ($x,$y,$z) = $userInput =~ m/(.+?)\s\+\s(.+?)\s=\s(.+)/;
> > die("wrong input format") unless(defined $x and defined $y and defined $z);
> 
> Others have shown you the proper way to do it, but I want to point out that
>    die "wrong input format" unless defined $z;
> would handle it.  If $z is defined, then there is no need to test $x or $y
> since they will be defined (even if they are null strings).

They can't be "null" strings (the common term is "empty") because all
captures have a "+" in it.  Also, $z isn't special.  If any one of the
captures is set, all will.

But using that test would require the reader to understand what the content
of one match has to say about the content of the others.  It is much clearer
to test if the regex has matched at all and then just use the captures.

Anno
-- 
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article.  Click on 
"show options" at the top of the article, then click on the 
"Reply" at the bottom of the article headers.


------------------------------

Date: Sun, 26 Mar 2006 16:34:35 +0200
From: "Lukas Mai" <rwxr-xr-x@gmx.de>
Subject: Re: sockaddr_in() timeout or asynchone call ?
Message-Id: <e068pq$ubd$01$1@news.t-online.com>

Asterbing <no@thanks.com> schrob:
> In article <240320061123222856%jgibson@mail.arc.nasa.gov>, 
> jgibson@mail.arc.nasa.gov says...
>> Which Perl manual? I have several. None of them come close to having 42
>> Chapters. Does your Perl manual have a title? An author? A publisher?
>> An edition number? Maybe it would be easier if you just posted the
>> code.
> 
> Of course. Here is the doc : <http://perl.enstimac.fr/perl-all-fr-
> pdf.pdf> and here is the code I'm using in a sub :

That's just a French translation of the perldocs. Chapter 42 is perldoc
perlipc.

> StatsRelay()
> {

That's not a sub, that's a syntax error.
[snip]

I don't see how your code can compile.

Lukas


------------------------------

Date: Sun, 26 Mar 2006 09:53:20 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Source Code release from Vendor
Message-Id: <xVxVf.183$m35.5892@news20.bellglobal.com>


"AcCeSsDeNiEd" <dillon@SpamMinuSaccessdenied.darktech.org> wrote in message 
news:ndfc22p2haom7qhn3t9f2bnujqp30uq0pj@4ax.com...
> Sorry for th OT. But I am unable to find any "specific" ng to post this
> question, Being a perly myself, I thought I would just post here.
>
> Was wondering, what is the "normal" practice here is sg when it comes to
> releasing the source code by a vendor which you hire to develop a
> software for you? If there is no contract in the 1st place and nothing
> indicating whether or not the source code would be retained/released by
> the vendor?
>
> And if the software was designed in-house with a in-house project
> manager? And only the programming labour was outsourced to the vendor in
> question.
>

If you hired the people to write the code for you, they generally can't 
claim to have control over it. Unless, of course, you're buying a pre-built 
software from them to include in your application (e.g., the restrictions on 
embedding MySQL without paying for a license), but then you would have had 
to sign a EULA.

I would hazard a guess that the code is yours to do with as you like based 
on your description, but would strongly suggest contacting a lawyer and not 
taking the advice of a usenet newsgroup if there's any reason to expect a 
lawsuit. Lacking a paper trail as you do, anything anyone tells you here is 
just speculation.

The converse, however, would make for a very difficult world: they 
contracted me to code this application they designed but since I wrote some 
code I now feel it's mine. It's kind of like a manufacturer claiming a 
patent is now his/hers because they manufactured the final product on their 
assembly line. But maybe there are secrets of production they don't want you 
disclosing... : )

I would strongly suggest writing up a standard form for your contracters to 
sign in the future, though (one that states in no uncertain terms that any 
code belongs to you and can be distributed/modified as you please). I would 
expect that your employees have already signed a confidentiality agreement 
stating that any code or ideas developed internally belong to the company.

Matt 




------------------------------

Date: Sun, 26 Mar 2006 09:44:51 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Source Code release from Vendor
Message-Id: <slrne2ddnj.n52.tadmc@magna.augustmail.com>

AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org> wrote:
^^^^^^^^^^^^
^^^^^^^^^^^^

You might consider not using a style often adopted by spammers.

I would normally delete a post like that unread, but I happen
to be bored on a Sunday morning this time...


> Sorry for th OT. But I am unable to find any "specific" ng to post this
> question, 


Head on over to:

   misc.int-property


There are some intellectual property lawyers lurking there.

Ignore the boneheads posting "Condo For Sale!" ads.   :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 26 Mar 2006 08:24:37 -0600
From: Donald King <dlking@cpan.org>
Subject: Re: XML::Simple and utf8 woes
Message-Id: <EuxVf.1268$IG.1227@dukeread01>

corff@zedat.fu-berlin.de wrote:
> Donald King <dlking@cpan.org> wrote:
> : [Whoops, I did the post-vs-mail thing again.  Bad coder, no cookie.]
> 
> : FWIW, I've taken your original test case from the top of the thread and
> : fixed it up.  It's now properly encoded in UTF-8, it uses both "use
> : utf8" and "binmode(STDOUT, ':utf8')" to fix the problem, and I fixed it
> : to run under "use strict" and "use warnings" while I was in there.  You
> : can download it at <http://chronos-tachyon.net/~chronos/corff.pl>.
> 
> Hi Donald,
> 
> Thank you _very_ much for the fixed code. I ran it, and to no avail. The
> problems remain. Can you tell me which environment the code worked for you?
> 
> My environment:
> 
> perl -v states:
> perl v5.8.5 built for i386-linux-thread-multi
> 
> echo $LANG states:
> en_US.UTF-8
> 
> in vim, opening the file in utf8 encoding succeeds (and displays correctly)
> 

My environment:

Perl: v5.8.8 built for i486-linux-gnu-thread-multi
LANG: en_US.UTF-8
Vim: encoding=utf-8 fileencoding=utf-8 termencoding=utf-8
Terminal: Gnome-Terminal w/ encoding set to "Current Locale (UTF-8)"

Typing "cat corff.pl" prints the source code, complete with funny German 
scribbles over the vowels.  ;-)

Oh, and since it may be relevant:
	XML::Simple version 2.14
	XML::Parser version 2.34
	XML::SAX version 0.12

Whoops, I think I just found the problem.  When I was checking version 
numbers, I went ahead and checked CPAN for newer versions.  After 
installing XML::SAX version 0.13, the code broke.  Try downgrading to 
0.12 and see if that fixes things.  (You can find a copy at 
<http://search.cpan.org/~msergeant/XML-SAX-0.12/>.)

-- 
Donald King, a.k.a. Chronos Tachyon
http://chronos-tachyon.net/


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 9092
***************************************


home help back first fref pref prev next nref lref last post