Javeed --

Is there a particular reason you sent your note to Shishir directly?
I've removed him from the Cc: line in case that matters...

...and then Javeed SAR said...
% 
% Hi,

Hello!


% 
% I am a begginer in perl?
%  i have a doubt.

Welcome :-)


% 
% when i create a file  it should not have space bar in it's file name;
% eg help file
% if it is there it should not create the file, it should throw a error
% message "space in file name not allowed"

OK.  We'll figure that you're getting the filename as input somehow,
since you're probably not generating random strings to have to worry
about spaces from yourself :-)

A simple pattern match will test for the space, and then you can continue
on.  Assuming we grab the input and store it as $input, something like

  ...
  if ( $input =~ / / )  # match a space
  {
    die "space in file name not allowed";
  }
  open (FILEHANDLE,$input);
  ...

Some people like to write this sort of thing as

  die "space in file name" if ( $input =~ / / );

or even

  die "space in file name" if  $input =~ / / ;

but I'm a bit pedantic about my pretty-printing :-)


% 
% can u help me in this.

Here's an attempt...


% 
% regards
% 
% javeed
% 


HTH & HAND

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg26312/pgp00000.pgp
Description: PGP signature

Reply via email to