'.' and '..' are two folders (I think) in every directory. '.' leads into the current directory, and '..' leads into the parent directory. If you're reading all the files in a foreach loop, you could just tell it next; if the filename is '.' or '..'. Or you could have it skip all filenames that start with a dot '.'.
For checking if a line has a semicolon, you can just use a regular expression or the index() function
regular...
User Profile
Collapse
-
Store package(class) name in a variable, and remove an instance of a package
Hello. I have 2 (probably simple) perl questions.
1. I want to store a package (or class) name in a variable. How do I do this? I want something like this:
I found you can do this with functions by doing \&functionnam e. Is there a similar way to do this for package names?Code:@classes=("myclass","myotherclass","anotheroneofmyclasses"); foreach(@classes){new $_;}
2. After...
No activity results to display
Show More
Leave a comment: