Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

First, welcome to the monastery, qwerty80, and to Perl.

Second, using scripts to delete files automatically when you don't know scripting is dangerous business. If there is a bug in your script you could end up deleting a LOT more than you intended. Please be careful.

"Delete these file" scripts are not good choices for beginner scripts. If there is any way you can do this manually on the command line I strongly recommend it, even if it will take more time. If you are using a pattern like "abc*.xml", first run a command to list files ( "ls" for unix, "dir" for windows). If you are getting the files you want to delete and only the files you want to delete, then carefully retype the command replacing dir/ls with a command to delete files. If you really must do this via a script, first write your script so that does nothing except print out the list of files, e.g.

foreach my $file (glob "/tmp/somedir/file*.xml") { print "<$file>\n"; }

Only after you are really, really sure that you are looping through the files you want to delete and nothing more, only then, should you replace the print "<$file>\n" with code to delete files. If what I've just said sounds too difficult, then again, doing this via script is not safe at all and you should really do this deletion task manually.

Third, I realize you are feeling desperate, but PerlMonks is not a coding service. We monks do not get real happy about questions like "I need a script give me one", even when one is urgently needed.

We are here to help people learn how to code in Perl, not to solve their homework or work problems for them. Our payback is the realization that we've helped someone become a slightly better coder and a slightly better coder in Perl particularly. We don't get your salary or your degree, just the satisfaction of helping someone learn.

For us to get that satisfaction the person has to show us what they want to learn, not simply ask for a solution. I think you will get a much more friendly response from people if you show the code you tried to write and to ask for help rather than say "script please?!".

In reply to Re: Need help by ELISHEVA
in thread Need help by qwerty80

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • 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 or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2022-01-27 18:19 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (71 votes). Check out past polls.