perldoc -f glob for starters.
It'll just do what you think it should.
e.g.
globfoo
=======
#!/usr/bin/perl -w
my @files = glob("foo*/ba*/");
print join "\n", @files, "\n";
mothra@penderel:~/src/Perl$ ls -d foo*/ba*/
foo1/bar1/ foo1/bar2/ foo1/bar3/ foo2/baz2/ foo2/baz3/
mothra@penderel:~/src/Perl$ ./globfoo
foo1/bar1/
foo1/bar2/
foo1/bar3/
foo2/baz2/
foo2/baz3/
etc.
It's probably a bad idea to roll your own logfile implementation (i.e. you could be learning lots of *other* things besides trying to make a wheel more round), but alas, to each their own.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|