GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Can anyone help with some Perl code? (https://gfy.com/showthread.php?t=582945)

ThunderBalls 03-04-2006 06:57 PM

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 03-04-2006 07:02 PM

Quote:

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.

:thumbsup

u-Bob 03-04-2006 07:26 PM

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

ThunderBalls 03-04-2006 08:31 PM

Quote:

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


Right on dude. Thanks! :thumbsup

u-Bob 03-05-2006 05:45 AM

np :)


All times are GMT -7. The time now is 11:05 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123