Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Answer: How do I delete/modify one line from test file ?

by Anonymous Monk
on Apr 04, 2001 at 01:07 UTC ( #69480=note: print w/replies, xml ) Need Help??


in reply to Answer: How do I delete/modify one line from test file ?
in thread files

I can't get that to work how. Could you post a more complete answer. I am feeding the push command the line that I want removed but it doesn't do anything. What am I doing wrong?
  • Comment on Re: Answer: How do I delete/modify one line from test file ?

Replies are listed 'Best First'.
Re: Re: Answer: How do I delete/modify one line from test file ?
by arturo (Vicar) on Apr 04, 2001 at 01:48 UTC

    well, if you're pushing the line you don't want onto the array, it's going to end up in the array. It might help to think of another way of doing the same thing:

    push @array, $line unless $line eq 'b|b';

    Read the fine manual! => perldoc -f push

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://69480]
help
Chatterbox?
[Corion]: Meh. I have a very simple mechanism to scrape+track prices, and even to send me mail if something changes (via cron), but SQLite doesn't support window functions, so my simple SQL to determine a price change won't work :-( Maybe I should store the DB ...
[Corion]: ... in Pg, but that would mean that I'd have to deal with credentials and stuff :)
[Corion]: In fact, the whole thing is just four simple programs, one App::scrape, another being DBIx::RunSQL, and one some glue to convert a JSON object into an SQL INSERT statement (+DBI connect/execute), so it would be an incredibly simple solution...
[Corion]: ... but that simplicity falls down due to SQLite letting me down and me being too lazy to move to a real DB. Maybe DBD::CSV can handle window functions...
[hippo]: Pg has the "trust" mechanism if you don't fancy using credentials for a trivial db.
[Corion]: hippo: Oooh, that sounds quite nice - let me read the documentation on that :)
[hippo]: https://www. postgresql.org/ docs/current/ static/auth- methods.html#AUTH- TRUST
[erix]: or compile & run an instance as yourself (not user 'postgres')
[erix]: easiest setup is to run with PG* env variables set, and a custom .pgpass files (can be a $PGPASSFILE)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2018-02-23 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (302 votes). Check out past polls.

    Notices?