Missing Something.

Jonathan Peterson JPeterson at bmjgroup.com
Mon Oct 1 16:13:31 BST 2007


>     open(EMACRXFNP02,
> "<content_data/spdm828a/emacrxfnp02.emea.bankofamerica.com");

It's always worth checking the return status of open, in case it couldn't 
open for some reason:
open(EMACRXFNP02,
"<content_data/spdm828a/emacrxfnp02.emea.bankofamerica.com") or die "I 
couldn't open the file because: $!";


>     @crxfnp02_users = <EMACRXFNP02>;
> 
>     close(EMACRXFNP02);
> 
> 
> 
>     $chester_userid = (param('chester_userid'));
> 
>     chomp $chester_userid;
> 
 
 
>     if         ($crxfnp02_users =~ m/$chester_userid /i ) {

$crxfnp02_users isn't the same as @crxfnp02_users. I'm guessing that 
perhaps you mean $crxfnp02_users[0] which is the first element in the 
array @crxfnp02_users. Or do you wish to check all the elements of 
@crxfnp02_users against $chester_userid and see if any of them match? 
Also, are you sure you want a regular expression match, or are you looking 
for an exact string match? At the moment, a username of '*' would always 
match!

If my assumptions are correct, then you probably want to 'use strict' so 
that perl stops you making that kind of mistake. It is regrettable that 
while 'use strict' is of primary importance to beginners, the manual page 
for it is unusually obscure and technical (
http://perldoc.perl.org/strict.html). Here's something more down to earth 
http://www.perlmonks.org/?node_id=111088.

You may find that for specific queries, the perlmonks website is more 
useful than london.pm.



_______________________________________________________________________
The BMJ Group is one of the world's most trusted providers of medical information for doctors, researchers, health care workers and patients www.bmjgroup.bmj.com.  This email and any attachments are confidential.  If you have received this email in error, please delete it and kindly notify us.  If the email contains personal views then the BMJ Group accepts no responsibility for these statements.  The recipient should check this email and attachments for viruses because the BMJ Group accepts no liability for any damage caused by viruses.  Emails sent or received by the BMJ Group may be monitored for size, traffic, distribution and content.  BMJ Publishing Group Limited trading as BMJ Group.  A private limited company, registered in England and Wales under registration number 03102371.  Registered office: BMA House, Tavistock Square, London WC1H 9JR, UK.
_______________________________________________________________________


More information about the london.pm mailing list