Can anyone help with some Perl code?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ThunderBalls
    So Fucking Banned
    • Oct 2002
    • 2926

    #1

    Can anyone help with some Perl code?

    What would be the proper syntax for this line if I want it to return 1 if anything in the $imageFilename contains .jpg? I know eq isnt right.

    if ($imageFilename eq .jpg) { return 1; }
  • bDok
    Confirmed User
    • Feb 2005
    • 1917

    #2
    Originally posted by ThunderBalls
    What would be the proper syntax for this line if I want it to return 1 if anything in the $imageFilename contains .jpg? I know eq isnt right.

    if ($imageFilename eq .jpg) { return 1; }
    you are going to need to write a regular expression to check for the .jpg in the filename.

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Warriors come out to plaAAaayyy!
    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

    Comment

    • u-Bob
      there's no $$$ in porn
      • Jul 2005
      • 33063

      #3
      if ($imageFilename =~ '.jpg') { return 1; }

      Comment

      • ThunderBalls
        So Fucking Banned
        • Oct 2002
        • 2926

        #4
        Originally posted by u-Bob
        if ($imageFilename =~ '.jpg') { return 1; }

        Right on dude. Thanks!

        Comment

        • u-Bob
          there's no $$$ in porn
          • Jul 2005
          • 33063

          #5
          np

          Comment

          Working...