@Anonymous Monk
Once again thanks for your help. Glob solves line break issue but... brings another one problem.
#Create database filenames table @files
my @ext = ("fb", "gdb", "ib");
my $data = "/opt/databases";
foreach (@ext) {
my $load = glob "$data*.$_";
push (@files, $load);
}
foreach (@files) {
print "Found database: $_ \n";
}
/opt/databases contains 5 files. Two with fb extension, three with gdb. Foreach loop should (as i think) push to @files table all filenames with extensions from @ext. Now this code works only for first extension on table @ext and second issue it inserts me in table @files first and last item empty. The execution result looks:
Found database:
Found database: /opt/databases/DEMO.fb
Found database: /opt/databases/demo2.fb
Found database:
The first and last are unwanted, they breaks the script at gbak - it dies due to empty filename to backup.
Second thing - why foreach loop breaks after first item from list and don`t push to @files other files as i think it should?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.