[28472] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9836 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 12 09:05:45 2006

Date: Thu, 12 Oct 2006 06:05:05 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 12 Oct 2006     Volume: 10 Number: 9836

Today's topics:
    Re: CGI Error in wwwboard <scobloke2@infotop.co.uk>
        CGI.pm v2.91 bug with $q->p()? <evillen@gmail.com>
    Re: Filtering duplicates out of an array <bigus@abdcdefghijk.com>
        howto detect printables in a string - norwegian charact <gladpike@hotmail.com>
    Re: howto detect printables in a string - norwegian cha anno4000@radom.zrz.tu-berlin.de
    Re: howto detect printables in a string - norwegian cha <serman_d@hotmail.com>
    Re: howto detect printables in a string - norwegian cha <gladpike@hotmail.com>
    Re: howto detect printables in a string - norwegian cha <jurgenex@hotmail.com>
    Re: howto detect printables in a string - norwegian cha <serman_d@hotmail.com>
    Re: howto detect printables in a string - norwegian cha <gladpike@hotmail.com>
    Re: howto detect printables in a string - norwegian cha <serman_d@hotmail.com>
    Re: Input into Net::Netmask <tadmc@augustmail.com>
    Re: LWP and Unicode <hjp-usenet2@hjp.at>
    Re: LWP and Unicode <rvtol+news@isolution.nl>
    Re: Net::SSH stuck usenet@DavidFilmer.com
    Re: question about using jpegtran for lossless compress <br276deleteme@cam.ac.uk>
    Re: replace variable with same variable <bart@nijlen.com>
        Research Collaboration Request bekijkfotos@gmail.com
    Re: Sorting and moving files to dir for DVD burn <bik.mido@tiscalinet.it>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 12 Oct 2006 10:26:42 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: CGI Error in wwwboard
Message-Id: <QcGdncKMV8LCl7PYnZ2dnUVZ8tGdnZ2d@bt.com>

duke@douglasadams.se wrote:
> Hi
> 
> I'm trying to set up Matt Wrights wwwboard

Matt's scripts have been notorious causes of very nasty problems 
(including huge security holes) for a decade or more! Delete it and 
download a better replacement from

http://nms-cgi.sourceforge.net/

Matt's scripts caused so many problems that a bunch of people were 
sufficiently motivated to rewrite them from scratch to try and reduce 
the harm that Matt's scripts were causing in the world.

> (http://www.scriptarchive.com/wwwboard.html) on one of my sites

Well, if scriptarchive.com has Matt's scripts thats a good enough reason 
for me to never visit scriptarchive.com!

> (www.bbbb.se/forum/wwwboard.html), but when I try to make a post, I get
> error message: "The specified CGI application misbehaved by not
> returning a complete set of HTTP headers."
> 
> Can anyone dig what that is about and help me?
> 

You are building your website with ancient rubbish. The only help I can 
offer is to suggest you build your website with better materials.


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

Date: 12 Oct 2006 02:12:33 -0700
From: "evillen@gmail.com" <evillen@gmail.com>
Subject: CGI.pm v2.91 bug with $q->p()?
Message-Id: <1160644353.694348.137950@c28g2000cwb.googlegroups.com>

I am getting a warning for reasons that I can't understand and I
hesitantly believe may be a bug with CGI.pm v2.91

Synopsis - in certain circumstances if I use the CGI.pm paragraph
method $q->p() my program will work correctly but I get a version of
the following warning in my webserver error.log:

filename.cgi: Use of uninitialized value in join or string at (eval 19)

line 15.

If I simply substitute $q->p() with "<br>" I get no warnings. The very
simple CGI code below demonstrates the problem, simply comment out
either of the final two "print" commands to see the behaviour.

It is possible that this behaviour relates to a problem with CGI.pm
v2.91 described here http://tinyurl.com/npta8 although I may be wrong
;-)

Thanks for any help
NJH

Test code - run directly from browser as filename.cgi
----------------

#!c:/perl/bin/perl.exe -w

use strict;
use diagnostics;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

my $q = new CGI;

#-------------------------------------------------
# Print the html header

print $q->header;
print <<END_HTML;

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<form method="post" enctype="multipart/form-data"
action="dev_test.cgi">
Type something here: <INPUT TYPE=text NAME=foo SIZE=50
MAXLENGTH=50><INPUT TYPE=submit VALUE="Submit"></P>
</form>
END_HTML

#-------------------------------------------------
#The "print" command below works fine using "<br>"
#print "You typed: ", $q->param("foo"), "<br>";

#The "print" command below creates the following warning using $q->p()
#"Use of uninitialized value in join or string at (eval 19) line 15."
print "You typed: ", $q->param("foo"), $q->p();



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

Date: Thu, 12 Oct 2006 09:07:15 +0100
From: "Bigus" <bigus@abdcdefghijk.com>
Subject: Re: Filtering duplicates out of an array
Message-Id: <egkt3n$odj$1@south.jnrs.ja.net>


<anno4000@radom.zrz.tu-berlin.de> wrote in message 
news:4p51mhFh1efoU1@news.dfncis.de...
> Bigus <bigus@abdcdefghijk.com> wrote in comp.lang.perl.misc:
>> "John W. Krahn" <someone@example.com> wrote in message
>> news:UJ3Xg.17077$H7.11961@edtnps82...
>>
>> >> There's a nice compact one-liner for making non-multidimensional 
>> >> arrays
>> >> uniqye, ie:
>> >>
>> >> @array = do {my %h; grep {!$h {$_} ++} @array;
>> >>
>> >> Can that be modified to do what I want?
>> >
>> > @array = do {my %h; grep {!$h {$_->[0]} ++} @array;
>>
>> actually, there is a related question - how do you make it case 
>> insensitive?
>>
>> This doesn't work:
>>
>> @array = do {my %h; grep {!$h {lc($_->[0])} ++} @array;
>
> Doesn't work how?  It selects members (which must be array refs) from
> the array so that their first elements are unique. It ignores case in
> the comparison, but doesn't change it.

sorry that was me being an idiot and using the wrong array position in my 
test script!

thanks
bigus 




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

Date: 12 Oct 2006 01:33:05 -0700
From: "RanLi" <gladpike@hotmail.com>
Subject: howto detect printables in a string - norwegian characterset
Message-Id: <1160641985.751712.110100@m73g2000cwd.googlegroups.com>

hi,
i have a problem. I need to detect printables in a string.
using perl and regular expressions.
problem is that I could have norwegian characters in this string, and
do I detect them???
I new to regex and perl .....

My current implementation looks like this. but will not work since the
special norwegian characters =E6=F8=E5 is not in the range. Anybody that
have experience with this problem???

print $line if ($line =3D~ m/^\w+$/);


thanks
ranli



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

Date: 12 Oct 2006 09:25:30 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <4p6g0aFh86fnU1@news.dfncis.de>

RanLi <gladpike@hotmail.com> wrote in comp.lang.perl.misc:
> hi,
> i have a problem. I need to detect printables in a string.
> using perl and regular expressions.
> problem is that I could have norwegian characters in this string, and
> do I detect them???
> I new to regex and perl .....
> 
> My current implementation looks like this. but will not work since the
> special norwegian characters æøå is not in the range. Anybody that
> have experience with this problem???
> 
> print $line if ($line =~ m/^\w+$/);

The meaning of "\w" is "all characters that can appear in a Perl
identifier".  That excludes special national characters and includes
"_".  That's not what you want.

Define the characters you want to allow in an explicit character class:

    /^[a-zæøåA-ZÆØÅ]+$/

If you have a locale that supports your characters,

    use locale;
    /^[[:alpha:]]+$/

should work as well.

Anno


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

Date: 12 Oct 2006 02:29:36 -0700
From: "Serman D." <serman_d@hotmail.com>
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <1160645376.167754.41330@i42g2000cwa.googlegroups.com>


RanLi wrote:

> problem is that I could have norwegian characters in this string, and
> do I detect them???

Create a regular expression containing the characters you want. Use the
qr//o operator to compile the query if you are to use the same pattern
repeatedly.

$ perl -wl
use strict;

my $RE =3D qr/^[_0-9a-zA-Z=E6=F8=E5=C6=D8=C5]+$/o;
my @lines =3D qw ( h=E6 h=E5 h=F8ne =3D() %&! =E5ssen );

foreach my $line (@lines){
  print $line if ($line =3D~ m/$RE/);
}
__END__

h=E6
h=E5
h=F8ne
=E5ssen

--=20
Serman D.



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

Date: 12 Oct 2006 03:32:26 -0700
From: "RanLi" <gladpike@hotmail.com>
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <1160649145.955615.201420@h48g2000cwc.googlegroups.com>

Serman D. skrev:
> RanLi wrote:
>
> > problem is that I could have norwegian characters in this string, and
> > do I detect them???
>
> Create a regular expression containing the characters you want. Use the
> qr//o operator to compile the query if you are to use the same pattern
> repeatedly.
>
> $ perl -wl
> use strict;
>
> my $RE =3D qr/^[_0-9a-zA-Z=E6=F8=E5=C6=D8=C5]+$/o;
> my @lines =3D qw ( h=E6 h=E5 h=F8ne =3D() %&! =E5ssen );
>
> foreach my $line (@lines){
>   print $line if ($line =3D~ m/$RE/);
> }
> __END__
>
> h=E6
> h=E5
> h=F8ne
> =E5ssen
>
> --
> Serman D.


Hi again,
Thanks alot for your reply.
But for some reason this does not work.

it is the last line in a file I need to skip, but only if it does not
contain a printable character.
this code does not detect these non-printable:
print "Inneholder printable =3D  $linje" if ($linje =3D~
m/^[_0-9a-zA-Z=E6=F8=E5=C6=D8=C5]+$/);

This is what is in the last line: But how to detect that this line does
not contain any printable characters?
$ tail -n -1 <file>  | od -ch
0000000   \0  \0      \n
            0000    200a
0000004

thanks again :)



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

Date: Thu, 12 Oct 2006 10:40:23 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <rYoXg.7582$W35.2898@trnddc06>

anno4000@radom.zrz.tu-berlin.de wrote:
> RanLi <gladpike@hotmail.com> wrote in comp.lang.perl.misc:
>> i have a problem. I need to detect printables in a string.
>> using perl and regular expressions.
>> problem is that I could have norwegian characters in this string, and

> The meaning of "\w" is "all characters that can appear in a Perl
> identifier".  That excludes special national characters and includes
> "_".  That's not what you want.

Could you please provide some reference?
I'm asking because this behaviour would be contrary to the documentation 
where it is clearly stated:

    If "use locale" is in effect, the
    list of alphabetic characters generated by "\w" is taken from the
    current locale.


> Define the characters you want to allow in an explicit character
> class:
>
>    /^[a-zæøåA-ZÆØÅ]+$/
>
> If you have a locale that supports your characters,
>
>    use locale;
>    /^[[:alpha:]]+$/

Why do you suggest [:alpha:] when the OP is explicitely asking for printable 
characters? Wouldn't [:print:] be better?

jue 




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

Date: 12 Oct 2006 04:01:59 -0700
From: "Serman D." <serman_d@hotmail.com>
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <1160650919.091909.261370@c28g2000cwb.googlegroups.com>



> But how to detect that this line does not contain any printable characters?
> $ tail -n -1 <file>  | od -ch
> 0000000   \0  \0      \n
>             0000    200a
> 0000004

What do you mean by "printable character"?

--



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

Date: 12 Oct 2006 04:24:50 -0700
From: "RanLi" <gladpike@hotmail.com>
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <1160652290.208431.261740@i3g2000cwc.googlegroups.com>

Serman D. skrev:
> > But how to detect that this line does not contain any printable charact=
ers?
> > $ tail -n -1 <file>  | od -ch
> > 0000000   \0  \0      \n
> >             0000    200a
> > 0000004
>
> What do you mean by "printable character"?
>
> --

Good question.
Printable...... visible characters.
aA-=E5=C5 and '+\{[]} etc.
im not interested in tab or linefeed, only want to check for visible
chars.
good enough explanation?
I m a noob at this stuff. difficult to be more spesific.

thanks. :)



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

Date: 12 Oct 2006 05:53:23 -0700
From: "Serman D." <serman_d@hotmail.com>
Subject: Re: howto detect printables in a string - norwegian characterset
Message-Id: <1160657603.476348.194680@m73g2000cwd.googlegroups.com>

RanLi wrote:

> Printable...... visible characters.
> aA-=E5=C5 and '+\{[]} etc.
> im not interested in tab or linefeed, only want to check for visible
> chars.
> good enough explanation?
> I m a noob at this stuff. difficult to be more spesific.

The more specific you are when posting a question, the better are your
chances of getting a good answer.

http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters

"Codes 33 to 126, known as the printable characters, represent
letters, digits, punctuation marks, and a few miscellaneous symbols."

$ perl -we 'for(my $i=3D33;$i<127;$i++) { print chr($i).q{ }; print
qq{\n} if ($i % 10) =3D=3D 0}'
! " # $ % & ' (
) * + , - . / 0 1 2
3 4 5 6 7 8 9 : ; <
=3D > ? @ A B C D E F
G H I J K L M N O P
Q R S T U V W X Y Z
[ \ ] ^ _ ` a b c d
e f g h i j k l m n
o p q r s t u v w x
y z { | } ~

ASCII does not contain any of your character special Norwegian
characters:

http://en.wikipedia.org/wiki/ISO_8859#Table

I also advice you to read perl's built-in documentation:

perldoc perl
perldoc perlre
perldoc perllocale

--



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

Date: Thu, 12 Oct 2006 06:42:50 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Input into Net::Netmask
Message-Id: <slrneisahq.3ct.tadmc@magna.augustmail.com>

Mumia W. (reading news) <paduille.4059.mumia.w@earthlink.net> wrote:
> On 10/11/2006 06:08 PM, mdeggers@gmail.com wrote:

>> @blocks = ('10.10.10.0/24','10.10.20.0/24');

>> for ($i = 0; $i < 3; $i++ )
> 
> Your "@blocks" array contains two elements, but you process four.
                                                              ^^^^

Three, m'lord.


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


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

Date: Thu, 12 Oct 2006 10:01:40 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: LWP and Unicode
Message-Id: <slrneirtj4.sc1.hjp-usenet2@yoyo.hjp.at>

On 2006-10-11 23:03, Ben Morrow <benmorrow@tiscali.co.uk> wrote:
>
> Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
>> On 2006-10-11 03:03, Ben Morrow <benmorrow@tiscali.co.uk> wrote:
>> > Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
>> >> On 2006-10-10 18:15, JÃŒrgen Exner <jurgenex@hotmail.com> wrote:
>> >> > Ted Zlatanov wrote:
>> >> >> On  6 Oct 2006, benmorrow@tiscali.co.uk wrote:
>> >> >>> It's not a question of this group's charter, it applies generally on
>> >> >>> Usenet. There is no header in a Usenet article that specifies a
>> >> >>> charset, so no way to use anything other than the default ASCII.
>> >> 
>> >> Content-Type: text/plain; charset=...
>> >> 
>> >> Introduced in RFC 1341 (June 1992). It is true that RFC 1036 was never
>> >> updated, but MIME is current practice on usenet.
>> >
>> > Really??? I was under the impression it was considered rude.
>> 
>> If it is, then most posters in this group are rude (well, some people
>> think this is the case even without MIME :-)).
>> 
>> I have currently 2805 messages from this group in my spool, 1954 of
>> which (70%) are MIME messages. Of these, about 1400 use ISO-8859-1,
>> about 400 use US-ASCII, about 70 UTF-8, and about 30 ISO-8859-15.
>
> OK, maybe I wasn't clear. What I meant was that actually making any
> *use* of MIME (as opposed to simply being passively conformant with it)
> such as multipart messages, signed messages;

Properly declaring the used charset *is* a use of MIME. There is no way
you can do that without using MIME.

(There are probably quite a few of those 1500 messages labelled as
non-ASCII which don't actually contain any non-ASCII characters. OTOH,
there are probably also quite few (for example yours in this thread)
which do contain non-ASCII characters and are missing a proper
declaration)

> in fact any messages that are not 'text/plain; charset=us-ascii'
> appears to me to be considered rude.

Given that about 50% of the messages in this group fit that description
and nobody except you is complaining, your perception appears to me to
be slightly off. 

> It really doesn't matter which of ISO-8859-* or UTF-8 people mark
> their message as, as long as they stick to US-ASCII for anything they
> want anyone else to be able to read.

This is a different matter. The language of this newsgroup is English,
so people should stick to English if they want to be understood. If they
do, their text will also consist mostly of ASCII characters (unless they
use fancy dashes and quotes or something like that).

>> Of these, only charset declarations are (AFAIK) widely used on usenet:
>
> ...and those are, in practice, redundant.

No, they aren't. They are necessary for the correct interpretation of
any non-ASCII characters in the message. This is nicely illustrated by
Jürgen's name in one of the attribution lines which is garbled some
more with each exchange between us. Now in this case the message can
still be understood with the garbled name, but if we are discussing, for
example, some problem with Perl unicode handling, it becomes extremely
irritating and tedious you can't be sure if the characters you see on
your screen are the same as the ones the poster typed (or pasted).


>> Transfer encodings aren't needed because NNTP is in practice 8bit clean. 
>
> Transfer encodings aren't needed because Usenet articles are in practice
> in US-ASCII, which doesn't need encoding;

It may have escaped your attention, but English is not the only language
used on Usenet, but it is the only language for which US-ASCII is
sufficient. I don't have any statistics at hand, but don't think I'm far
off when I estimate that about half of the (text) traffic on Usenet is
not in English, and therefore also not in US-ASCII.

>> The charset parameter is needed whenever a message contains non-ASCII
>> characters.
[...]
>> So a newsreader may not need to support all 5 MIME RFCs, but if it
>> doesn't at least support text/plain with the most frequent charsets
>> and RFC 2047, it's at least a bit of a pain.
>
> I completely agree with the sentiment here: the ability to write in
> other charsets would be very useful.

Not "would" - it *is* very useful. Indeed, for those of us who write in
other languages than English it is pretty much indispensable.

> However, my newsreader, although it makes some attempt to handle MIME,
> doesn't appear to handle them at all; while you could say 'that's your
> problem'

I do. You are using a newsreader which hasn't been maintained for 5
years.

> I would respectfully disagree until 1036 is updated.

I've almost given up hope on that. I don't recall when USEFOR was
established, but it must have been in the late 90's. So far they haven't
managed to produce a single RFC.

	hp


-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd


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

Date: Thu, 12 Oct 2006 12:37:46 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: LWP and Unicode
Message-Id: <egld45.1gs.1@news.isolution.nl>

Ben Morrow schreef:

> Transfer encodings aren't needed because Usenet articles are in
> practice in US-ASCII, which doesn't need encoding; alse because
> newsreaders don't decode them.

In practice many articles include non-ASCII characters, more and more.
If an article is made of only ASCII, then the news client should refrain
from including MIME-headers, and the good news clients do it that way.


> the ability to write in
> other charsets would be very useful. However, my newsreader, although
> it makes some attempt to handle MIME, doesn't appear to handle them
> at all; while you could say 'that's your problem' I would
> respectfully disagree until 1036 is updated.

In practice it is updated by 'Son-of-RFC-1036' and even more by how the
majority of articles are structured. In practice, RFCs can't keep up,
but news clients can.

-- 
Affijn, Ruud

"Gewoon is een tijger."



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

Date: 12 Oct 2006 00:54:21 -0700
From: usenet@DavidFilmer.com
Subject: Re: Net::SSH stuck
Message-Id: <1160639661.430421.83800@i3g2000cwc.googlegroups.com>

Stephane Habett Roux wrote:
> I don't know this module but i guess there's at least a username
> missing.

By default, the module uses the username of the client user.  You only
need to specify the username if it is different on the target system.

-- 
David Filmer (http://DavidFilmer.com)



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

Date: Thu, 12 Oct 2006 13:21:59 +0100
From: Ben Rudiak-Gould <br276deleteme@cam.ac.uk>
Subject: Re: question about using jpegtran for lossless compression of jpegs
Message-Id: <eglc18$ghv$1@gemini.csx.cam.ac.uk>

ewaguespack@gmail.com wrote:
> so the question is, how do I remove the jfif header in a scripted,
> recursive fashion in Linux.

I'm curious why you want to do this, as the header takes almost no space and 
without it a lot of software probably won't recognize the image. I don't 
know of any existing utility that'll strip the JFIF header, but this should 
do the trick:


   /* Strip JFIF headers from the JPEG image on stdin, and write
      the result to stdout. Won't work unmodified on Windows
      because of the text/binary problem. Not thoroughly tested. */

   #include <stdio.h>
   #include <stdlib.h>

   void fail(const char* msg)
   {
       fputs(msg, stderr);
       exit(1);
   }

   void copy_rest(FILE* f, FILE* g)
   {
       char buf[4096];
       int len;
       while ((len = fread(buf, 1, sizeof buf, f)) > 0) {
           if (fwrite(buf, 1, len, g) != len)
               fail("write error");
       }
       if (len < 0)
           fail("read error");
   }

   void strip_app0(FILE* f, FILE* g)
   {
       int a,b;
       a = getc(f); b = getc(f);
       if (a != 0xFF || b != 0xD8)
           fail("not a JPEG file");
       putc(a,g); putc(b,g);
       while (a = getc(f), b = getc(f), a == 0xFF && b == 0xE0) {
           a = getc(f); b = getc(f);
           if (a == EOF || b == EOF)
               fail("stop confusing me with weird test cases");
           fseek(f, a * 256 + b - 2, SEEK_CUR);
       }
       if (a != EOF) putc(a,g);
       if (b != EOF) putc(b,g);
       copy_rest(f,g);
   }

   int main()
   {
     strip_app0(stdin,stdout);
     return 0;
   }


-- Ben


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

Date: 12 Oct 2006 03:07:53 -0700
From: "Bart Van der Donck" <bart@nijlen.com>
Subject: Re: replace variable with same variable
Message-Id: <1160647673.210527.166070@m73g2000cwd.googlegroups.com>

Uri Guttman wrote:

> [...]
>
> well, what you have shown is not relevent to the actual problem with
> $&. anno showed a better test which highlights the issue. it is not the
> speed of using $& itself but that using $& ANYWHERE in your program
> slows down ALL other s/// ops which do grabbing. this is because $& is
> global and could be used anywhere at any place in the code so all s///
> ops need to do an extra copy of their original string in case some $&
> will refer to it. by using $1 you will only copy the original string in
> s/// when you actually need it for the $1.

Well understood. Thanks!

-- 
 Bart



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

Date: 12 Oct 2006 04:55:02 -0700
From: bekijkfotos@gmail.com
Subject: Research Collaboration Request
Message-Id: <1160654102.624254.52580@i3g2000cwc.googlegroups.com>

Dear perl newsgroups,

I am looking for someone with Perl skills that is willing to help me in
a small research project.

What I have to offer:
- Co-author ship on an abstract that will be submitted to a scientific
meeting.
- Possibly, co-author ship on an 'original research' manuscript for
a scientific journal.
- An Erdos number of 6 :)

Information
The International Society for Magnetic Resonance in Medicine (ISMRM) is
a nonprofit professional association devoted to furthering the
development and application of magnetic resonance techniques in
medicine and biology. The Society holds annual scientific meetings,
where people present new research in the form of abstracts to their
colleagues. My goal is to determine the publication rate of MRI related
papers in scientific journals, originally presented at these meetings.
It is very interesting to know whether research presented at the ISMRM
is good enough to publish (e.g. listed in the pubmed database), and on
what kind of timescale this happens. I informed a member of the board
of Trustees of the ISMRM about my intentions, and he was very
interested.

A similar approach has been performed to analyze the 'publication
rate' for different meetings:
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=3Dpubmed&cmd=3DRetrieve&do=
pt=3DAbstractPlus&list_uids=3D10445467
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=3Dpubmed&cmd=3DRetrieve&do=
pt=3DAbstractPlus&list_uids=3D16715236
http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=3Dpubmed&cmd=3DRetrieve&do=
pt=3DAbstractPlus&list_uids=3D15166324

In the above mentioned manuscripts, for each abstract a manual search
was conducted. In my opinion, it should also be possible to create an
automated procedure.

This procedure should contain the following steps:
- Parsing of a pdf (or text) file, which lists all abstracts of the
ISMRM, to create a database with relevant information.
- Performing a set of queries in Pubmed for each abstract, to maximize
the sensitivity of procedure.

For example, I will use one of my own abstracts to illustrate the
possible different appearance of an abstract and its final publication
in a journal:

Abstract:
J=2EF.A. Jansen, J.M. Hakum=E4ki, L. Ifeanyi, M. Shamblott, J. Gearhart
and P.C.M. van Zijl
1H-NMR spectroscopy of stem cells in vitro demonstrates high
proliferation state.
Proc. Int. Soc. Mag. Reson. Med. 10, Honolulu, Hawaii, USA, May 2002:
131

Paper:
Jacobus F.A. Jansen, Michael J. Shamblott, Peter C.M. van Zijl, Kimmo
K=2E Lehtim=E4ki, Jeff W.M. Bulte, John D. Gearhart, and Juhana M.
Hakum=E4ki
Stem Cell Profiling by Nuclear Magnetic Resonance Spectroscopy.
Magnetic Resonance in Medicine 56 (3): 666-670 SEP 2006

Although both the abstract and the paper describe essentially the same
research, the title has changed, and the authors are different. It
requires a relative sophisticated search algorithm to find the paper
based on the information from the abstract, and to consider it as a
match.

Unfortunately my Perl skills are very limited, and I don't think it
is plausible that I will succeed in creating this sophisticated search
algorithm. Therefore I was hoping that someone could help me out with
this. (e.g. a student who could use it to improve his/her resume?). If
possible, I'd like to submit the results as an abstract for the ISMRM
2007, for which the deadline is 15 November 2006.
I know my post is a wild shot which might yield nothing, but I reckoned
that I should try it anyway.

My contact information can be found here:
http://yp.bmt.tue.nl/showemp.php/1849


With kind regards,

Jaap Jansen



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

Date: 12 Oct 2006 11:22:31 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Sorting and moving files to dir for DVD burn
Message-Id: <f12si2t373777ibqe631k6b404frnkcmrl@4ax.com>

On 11 Oct 2006 19:27:27 -0700, "romorris@bellsouth.net"
<romorris@bellsouth.net> wrote:

>Im sure someone done this, probally for MP3's, and knows how to do it
>in such a simple fashion with perl, so I have to ask this:
>
> I have a quite few files (~230), all different sizes ( 2megs~200megs )
> all in one directory. All files are compressed(.Z).
>
> What I want to do is somehow sort and move these into seperate
>directories filling each as close to 4 gigs as possible. This way I can

Notoriously, this is a mathematically hard problem, precisely the
"knapsack problem". However for more pointers you may look into the
following PM thread:

http://perlmonks.org/?node_id=546968

which BTW has some "suspiscious" similarities with this message
itself...


HTH,
Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

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 9836
***************************************


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