List Info

Thread: Re: Getting Arguments using Command Line




Re: Getting Arguments using Command Line
user name
2007-02-02 07:25:53
The Following also not give me proper result.


--- Abdul <a22khanyahoo.com> wrote:

> Run that like this --->
> 
>  perl test.pl 'D:First Foldertest' 'D:Second
> Folder'
> 
> value the quotes )
> 
> srini vasan <ensrinivasanyahoo.co.in> wrote:     
 
>                           Hi All,
>  
>  Below is my perl script:
>  
>  use strict;
>  use warnings;
>  
>  print "First Argument: $ARGV[0]";
>  print "n********************n";
>  print "Second Argument: $ARGV[1]";
>  
>  When I execute this  with arguments
>  perl test.pl "D:First Foldertest"
"D:Second
>  Folder"
>  
>  The Output shown was:
>  First Argument: D:First Foldertest" D:Second
>  ********************
>  Second Argument: Folder
>  
>  The Output what I expect is:
>  First Argument: D:First Foldertest
>  ********************
>  Second Argument: D:Second Folder
>  
>  Is there any idea to get the output what i expect,
>  without changing Backward slashes to Forward
> slashes
>  or Deleting the Final slash in First argument
>  
>  My OS is Windows.
>  
>  Thanks in Advance
>  Srinivasan
>  
>    
> 
>
__________________________________________________________
>  Yahoo! India Answers: Share what you know. Learn
> something new
>  http://in.answers.yahoo.
com/
>  
>      
>                        
> 
>  		
> ---------------------------------
>  Yahoo! Movies - Search movie info and celeb
> profiles and photos.
> 
> [Non-text portions of this message have been
> removed]
> 
> 



		
__________________________________________________________
Yahoo! India Answers: Share what you know. Learn something
new
http://in.answers.yahoo.
com/


Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Tainting Untainting
user name
2007-02-02 08:50:39
Tainting Untainting

I am trying to write code that insure safe input from a
form.
This is what I have come up with after a few days of
study...
Being that I  am a beginner at this I am sure it is quite
incomplete,
but I don't know how.

Help? Ideas? Pointers?
Thanks
Lou


  # chomps n's
      $value =~ s/n//g;
  # deletes embedded HTML comments - Security measure to
prevent subverting
server side includes
      $value =~ s/<!--(.|n)*-->//g;
      # Filters out  everything not in th is list
a-zA-Z0-9.-_
      $value =~ s/[^a-z0-9.-_]//ixg; # i=ignore case
x=ignore
whitespace g=all occurances
  # Check for email address. if an  appears, split and
reconstitiute as an
email address
  if ($value =~ m/*./) # email address else
  {
   #### This will untaint for -T
       $value =~ m/(S+)([w.-]+)/;
     $value = "$1$2";
  }
  # delete first dashes
  #while (m/-*/)
  while (substr($value,0,1) eq "-")
  {
   $value = substr($value,1,(length $value) - 1);
  }
  # delete commands system, exec & unlink
  if ($value =~ m/system/i || $value =~ m/exec/i || $value
=~ m/unlink/i)
  {
   FailPage("Unsafe verbage is being used.<BR>Do
not use the phrase
"$value"");
  }



Unsubscribing info is here: h
ttp://help.yahoo.com/help/us/groups/groups-32.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://g
roups.yahoo.com/group/perl-beginner/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http
://groups.yahoo.com/group/perl-beginner/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:perl-beginner-digest@yahoogroups.com 
    mailto:perl-beginner-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    perl-beginner-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )