This is a discussion on "Understadning Perl Basics" within the Other Programming Languages section. This forum, and the thread "Understadning Perl Basics are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Understadning Perl Basics
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Understadning Perl Basics
Hi,
The reason for the topic tilte is because I'l be asking various questions in the same thread over a period of time, easier then making a million threads! Anyway, I'm having a problem with one of my scripts. What I want to do is read a file that the user inputs. E.g - stats.txt will open the file. However, what i want to do, is that if the user doesn't enter a extension of .txt it will automatically add it. My attempt:
Any help is greatly appreciated. |
|
|
|
#2
|
|||
|
|||
|
Re: Understadning Perl Basics
try this
Last edited by karinne; Aug 9th, 2007 at 17:54. Reason: Please use [ code ]...[ /code ] tags when displaying code. |
|
#3
|
|||
|
|||
|
Re: Understadning Perl Basics
OR this..yu missed the backslash before .txt...if ($file !~ m/.txt$/)
it should be if ($file !~ m/\.txt$/)
Last edited by karinne; Aug 9th, 2007 at 18:16. Reason: Again ... please use [ code ]...[ /code ] tags when displaying code. |
![]() |
| Tags |
| basic, perl |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mod rewrite basics shared hosting | maniac | PHP Forum | 6 | Feb 28th, 2008 23:09 |
| Getting the basics right... | nuddy | Web Page Design | 11 | Jan 13th, 2007 20:47 |
| Can somebody lay down the basics of PHP for me plz | Physt | PHP Forum | 2 | Oct 10th, 2004 13:32 |