Loading ...
Sorry, an error occurred while loading the content.

4219testing the start of a string..

Expand Messages
  • Franki
    Jul 1, 2001
    • 0 Attachment
      Hi again all..

      I have another small question,

      if I have a variable,, say: $myVar="a:bigLongString"

      and I want to test for the presense of a:big at the start of it.. (and it
      must allow for either upper or lower case)

      what would be the easiest way of doing that?
      should I use split to take off the chars 0 though 4 and use an if/or
      statement to compare it to a:big or A:BIG ?

      what happens then if its mixed case? how can I tell it to ignore case
      altogether?

      also, if I want to test for the presence of String and remove it if its
      there, do I use the same method?

      I am trying to find a relivent section in my perl books, but I have read 40
      pages so far and haven't found anything relivent..

      and there is probably two dozen people in this list who could answer off the
      top of their head...

      any response would be kindly appreciated..

      regards

      Frank






      -----Original Message-----
      From: Franki [mailto:frankieh@...]
      Sent: Sunday, 1 July 2001 11:33 PM
      To: perl-beginner@yahoogroups.com
      Subject: [PBML] Some questions about stuff..



      Hi everyone...

      I am sorry to be a bother, but I have a couple of questions I would like to
      here your word on...


      1. I have to encryption modules that we use for generating a checksum to
      make sure that what is sent in a form post is what gets received at the
      other end..
      We need to give away this script to lots of people, and the checksum modules
      will be useless if everyone knows how it is done.. So I am wondering if its
      possible to use compiled binaries for the modules and access them from a
      standard perl script?? also, we need to do it for both the unix version of
      the script and also the windows version...

      or is there some other way to protect the source of the modules??? (they are
      called directly by the script, not installed in the perl modules
      directories..)

      2. URL strings not working if there are spaces.... like so:
      &SHIPMETHOD=Ground%20Shipping

      This works ok in the unix version of the script, but the win32 one stops
      dead at &SHIPMETHOD=Ground (ie it stops on the first space and all following
      pairs are ignored... so the script fails,

      The only stuff that is changed between the two versions is the path to lib
      statements, and stuff like that, the actual code is the same.

      3. I am wondering if it is safe to use $ENV{'PATH_TRANSLATED'} to initially
      set the value of my $PaTh variable for my NT/2000 version of my scipt..
      (after stripping of the pl file at the end of the string that
      $ENV{'PATH_TRANSLATED'} produces..

      is it safe to do this? I was thinking of using it when the script is first
      run, and then the script asks if the path is correct and if so writes it
      permanently to file so that $ENV{'PATH_TRANSLATED'} need never be used
      again...



      Any help suggestions, critism, general comments, anything,,, would be most
      appreciated...




      kindest regards

      Frank







      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    • Show all 7 messages in this topic