[24302] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6493 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 30 14:10:55 2004

Date: Fri, 30 Apr 2004 11:10:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 30 Apr 2004     Volume: 10 Number: 6493

Today's topics:
    Re: search.pl (GreenLight)
    Re: search.pl <mark.clements@kcl.ac.uk>
    Re: search.pl <dwall@fastmail.fm>
    Re: search.pl <bik.mido@tiscalinet.it>
    Re: search.pl <Joe.Smith@inwap.com>
    Re: search.pl <tassilo.parseval@rwth-aachen.de>
    Re: search.pl <dwall@fastmail.fm>
    Re: search.pl <webmaster @ infusedlight . net>
    Re: search.pl <webmaster @ infusedlight . net>
    Re: search.pl <webmaster @ infusedlight . net>
    Re: search.pl <webmaster @ infusedlight . net>
    Re: search.pl <webmaster @ infusedlight . net>
    Re: search.pl <webmaster @ infusedlight . net>
    Re: Suggestions on editing multiple files <Joe.Smith@inwap.com>
        System Command Results <reachus@netlink.info>
    Re: System Command Results <remorse@partners.org>
        tunneling di richieste cookies <vstefanoxx.bogacussu@tiscali.it>
        WHAT IS THE POINT OF FORMMAIL ? <nobody@dizum.com>
    Re: WHAT IS THE POINT OF FORMMAIL ? <uri@stemsystems.com>
    Re: WHAT IS THE POINT OF FORMMAIL ? <cwilbur@mithril.chromatico.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 30 Apr 2004 05:55:12 -0700
From: google@milbaugh.com (GreenLight)
Subject: Re: search.pl
Message-Id: <c4b60ce1.0404300455.19cb718b@posting.google.com>

"Robin" <webmaster @ infusedlight . net> wrote in message news:<c6st0v$3de$1@reader2.nmix.net>...
>  #code for parsing results
>     foreach my $dir (@directories)
>      {
>      opendir (DIR, $dir);
>      my @files_from_dir = readdir (DIR);
>      closedir (DIR);
>      foreach my $file (@files_from_dir)
>       {
>       if (! -d $file)
>        {
>        parse ($file, $dir);
>        }
>      }
>       }

Do you really indent your code like that, or is this just an artifact of
whatever utility that you use to post to clpm? That is so painful to look at
that I cannot even consider analyzing it to help you with your problems...

--
my real address is perl - at - milbaugh - dot - com


------------------------------

Date: Fri, 30 Apr 2004 14:01:20 +0100
From: Mark Clements <mark.clements@kcl.ac.uk>
Subject: Re: search.pl
Message-Id: <40924e1c$1@news.kcl.ac.uk>

GreenLight wrote:

> "Robin" <webmaster @ infusedlight . net> wrote in message news:<c6st0v$3de$1@reader2.nmix.net>...
<snip>
> Do you really indent your code like that, or is this just an artifact of
> whatever utility that you use to post to clpm? That is so painful to look at
> that I cannot even consider analyzing it to help you with your problems...

Robin: you could do with looking at templating solutions, eg 
HTML::Template or Template-Toolkit (though there are a fair number out 
there and people tend to have strong opinions about choice of templating 
package). Embedding HTML ie presentation and content directly within a 
script makes it hard to read and hard to maintain. It also makes it very 
difficult to work with web designers who may not have any knowledge of 
Perl.

As far as the indenting goes, check out perltidy.

Mark


------------------------------

Date: Fri, 30 Apr 2004 14:31:36 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: search.pl
Message-Id: <Xns94DB6B155A0B2dkwwashere@216.168.3.30>

Robin <webmaster @ infusedlight . net> wrote:

> I have some questions on this , why isn't sub parse and sub search
> not performing the way I want them too, they are supposed to go
> through all of the directories and then open the files in them and
> then if the contents of the file match param ('query') print the
> results. It's been driving me crazy, if someone could point me in
> the right direction it would be great. 

    use File::Find;

Writing your own code to recurse through directories is a useful 
exercise, but if you just want to get the program written and use it, 
File::Find is faster and easier to use, and almost certainly more 
robust.

I'd also suggest not printing the results immediately, but save them 
somewhere (possibly in an array of some sort, maybe of hashes) and 
only print them out when the search has finished.

And please, *please*, format your code in a readable way.  perlstyle 
has suggestions. You don't have to follow them exactly, but at least 
pick a style and use it *consistently*.  If I didn't have perltidy 
available to reformat your code I would not have even bothered to 
skim over it. If you don't have an editor that assists with 
indenting, then get one.


> sub parse
>     {
>     my ($filetoparse, $dirtoparse) = @_;
>     my @results;
>     open (FILE, $filetoparse) or push (@errors, "A file open
>     operation failed.");

So if the open fails, save a non-informative message in an array 
(which file? why did it fail?) ...

>     flock (FILE, LOCK_SH) or push (@errors, "A file lock operation
> failed.");
>     my @filecontents = <FILE>;

 ...and then try to read it anyway.

>     close (FILE);
>     chomp (@filecontents);

 ...and then do other stuff with an empty array.


Hmmm...

[I got tired at this point and stopped reading]


------------------------------

Date: Fri, 30 Apr 2004 16:38:56 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: search.pl
Message-Id: <2vc490l52bea3dsus9dvkpnf1mlovb8en2@4ax.com>

On Thu, 29 Apr 2004 22:50:38 -0800, "Robin" <webmaster @ infusedlight
 . net> wrote:

>I have some questions on this , why isn't sub parse and sub search not
>performing the way I want them too, they are supposed to go through all of
>the directories and then open the files in them and then if the contents of
>the file match param ('query') print the results. It's been driving me

I have not read your code, but I seemed to notice some readdir()s so
from what is described above I feel like pointing out that the
standard answer -and indeed generally a good one!- to this kind of
questions is 'use File::Find'. Maybe you knew, maybe you don't: if you
didn't, it's there for your ease!


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


------------------------------

Date: Fri, 30 Apr 2004 15:22:34 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: search.pl
Message-Id: <_aukc.3350$0H1.362719@attbi_s54>

Robin wrote:

>      opendir (DIR, $dir);
>      my @files_from_dir = readdir (DIR);
>      closedir (DIR);
>      foreach my $file (@files_from_dir)
>       {
>       if (! -d $file)
>        {
>        parse ($file, $dir);
>        }
>      }
>       }

1) You really messed up on the indentation there.
2) Your main logic error is in the argument to -d() and parse(); it's
    incomplete.  Anytime $dir is not the same as ".", your code will fail.

   foreach my $fil (@files_from_dir) {
     my $file = "$dir/$fil";
     parse($file,$dir) if -f $file;
   }

	-Joe


------------------------------

Date: Fri, 30 Apr 2004 17:37:33 +0200
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: search.pl
Message-Id: <c6trrv$fv1ra$1@ID-231055.news.uni-berlin.de>

Also sprach Michele Dondi:

> On Thu, 29 Apr 2004 22:50:38 -0800, "Robin" <webmaster @ infusedlight
> . net> wrote:
> 
>>I have some questions on this , why isn't sub parse and sub search not
>>performing the way I want them too, they are supposed to go through all of
>>the directories and then open the files in them and then if the contents of
>>the file match param ('query') print the results. It's been driving me
> 
> I have not read your code, but I seemed to notice some readdir()s so
> from what is described above I feel like pointing out that the
> standard answer -and indeed generally a good one!- to this kind of
> questions is 'use File::Find'. Maybe you knew, maybe you don't: if you
> didn't, it's there for your ease!

As far as I could see, he is not recursing further into subdirectories.
For ordinary directory listings, I'd use readdir() alright.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval


------------------------------

Date: Fri, 30 Apr 2004 17:19:06 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: search.pl
Message-Id: <Xns94DB877B7FBE9dkwwashere@216.168.3.30>

Tassilo v. Parseval <tassilo.parseval@rwth-aachen.de> wrote:

> Also sprach Michele Dondi:
> 
>> On Thu, 29 Apr 2004 22:50:38 -0800, "Robin" <webmaster @
>> infusedlight . net> wrote:
>> 
>>>I have some questions on this , why isn't sub parse and sub
>>>search not performing the way I want them too, they are supposed
>>>to go through all of the directories and then open the files in
>>>them and then if the contents of the file match param ('query')
>>>print the results. It's been driving me 
>> 
>> I have not read your code, but I seemed to notice some readdir()s
>> so from what is described above I feel like pointing out that the
>> standard answer -and indeed generally a good one!- to this kind
>> of questions is 'use File::Find'. Maybe you knew, maybe you
>> don't: if you didn't, it's there for your ease!
> 
> As far as I could see, he is not recursing further into
> subdirectories. For ordinary directory listings, I'd use readdir()
> alright. 

Yeah, you're right.  I didn't look closely enough either.



------------------------------

Date: Fri, 30 Apr 2004 09:50:37 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: search.pl
Message-Id: <c6u489$1fv$1@reader2.nmix.net>


"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:Ad6dnQgBHIYXYQzdRVn-jA@adelphia.com...
> Robin wrote:
>
> > I have some questions on this , why isn't sub parse and sub search not
> > performing the way I want them too, they are supposed to go through all
of
> > the directories and then open the files in them and then if the contents
> > of the file match param ('query') print the results. It's been driving
me
> > crazy, if someone could point me in the right direction it would be
great.
>
> Your script passes the directory to parse(), but it doesn't look like
> parse() is using it. So any file that isn't in the current directory
('./')
> won't get parsed.

parse uses the directory when the link is printed out.

> >     open (FILE, $filetoparse) or push (@errors, "A file open operation
> > failed.");
>
> You should be using more helpful error messages. The above tells you
nothing
> more than that a file failed to open - it would be better if it also told
> you what file and why. Including the file name and $! would make this bug
> easier to find.

yes, this is my first draft and I haven't really worked in the error
checking routine, but I will....

-Robin




------------------------------

Date: Fri, 30 Apr 2004 09:52:31 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: search.pl
Message-Id: <c6u48a$1fv$2@reader2.nmix.net>


"GreenLight" <google@milbaugh.com> wrote in message
news:c4b60ce1.0404300455.19cb718b@posting.google.com...
> "Robin" <webmaster @ infusedlight . net> wrote in message
news:<c6st0v$3de$1@reader2.nmix.net>...
> >  #code for parsing results
> >     foreach my $dir (@directories)
> >      {
> >      opendir (DIR, $dir);
> >      my @files_from_dir = readdir (DIR);
> >      closedir (DIR);
> >      foreach my $file (@files_from_dir)
> >       {
> >       if (! -d $file)
> >        {
> >        parse ($file, $dir);
> >        }
> >      }
> >       }
>
> Do you really indent your code like that, or is this just an artifact of
> whatever utility that you use to post to clpm? That is so painful to look
at
> that I cannot even consider analyzing it to help you with your problems...

The code has screwed up indendation because of my newsreader which does some
weird stuff with tabs and spaces, but it looks fine when I edit it, and also
when I open the file with a text editor, it's just when I paste it into
something, sorry for posting code that's hard to read.

> my real address is perl - at - milbaugh - dot - com




------------------------------

Date: Fri, 30 Apr 2004 09:53:56 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: search.pl
Message-Id: <c6u48b$1fv$3@reader2.nmix.net>


"Mark Clements" <mark.clements@kcl.ac.uk> wrote in message
news:40924e1c$1@news.kcl.ac.uk...
> GreenLight wrote:
>
> > "Robin" <webmaster @ infusedlight . net> wrote in message
news:<c6st0v$3de$1@reader2.nmix.net>...
> <snip>
> > Do you really indent your code like that, or is this just an artifact of
> > whatever utility that you use to post to clpm? That is so painful to
look at
> > that I cannot even consider analyzing it to help you with your
problems...
>
> Robin: you could do with looking at templating solutions, eg
> HTML::Template or Template-Toolkit (though there are a fair number out
> there and people tend to have strong opinions about choice of templating
> package). Embedding HTML ie presentation and content directly within a
> script makes it hard to read and hard to maintain. It also makes it very
> difficult to work with web designers who may not have any knowledge of
> Perl.

I'll keep it in mind, I've never used either one, I tend to work with
minimal modules because it's sometimes a compatibility issue with some
servers using scripts that don't have the modules that I'm using...but
thanks.

> As far as the indenting goes, check out perltidy.

I will check it out. See above.

> Mark




------------------------------

Date: Fri, 30 Apr 2004 09:56:40 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: search.pl
Message-Id: <c6u48c$1fv$4@reader2.nmix.net>


"David K. Wall" <dwall@fastmail.fm> wrote in message
news:Xns94DB6B155A0B2dkwwashere@216.168.3.30...
> Robin <webmaster @ infusedlight . net> wrote:
>
> > I have some questions on this , why isn't sub parse and sub search
> > not performing the way I want them too, they are supposed to go
> > through all of the directories and then open the files in them and
> > then if the contents of the file match param ('query') print the
> > results. It's been driving me crazy, if someone could point me in
> > the right direction it would be great.
>
>     use File::Find;
>
> Writing your own code to recurse through directories is a useful
> exercise, but if you just want to get the program written and use it,
> File::Find is faster and easier to use, and almost certainly more
> robust.
>
> I'd also suggest not printing the results immediately, but save them
> somewhere (possibly in an array of some sort, maybe of hashes) and
> only print them out when the search has finished.

yeah, I was thinking that exact same thing. I'll check out file::find.

>
> And please, *please*, format your code in a readable way.  perlstyle
> has suggestions. You don't have to follow them exactly, but at least
> pick a style and use it *consistently*.  If I didn't have perltidy
> available to reformat your code I would not have even bothered to
> skim over it. If you don't have an editor that assists with
> indenting, then get one.

yeah, next time I post code I will make sure it's formatted good.

-Robin





------------------------------

Date: Fri, 30 Apr 2004 09:57:23 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: search.pl
Message-Id: <c6u48d$1fv$5@reader2.nmix.net>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:2vc490l52bea3dsus9dvkpnf1mlovb8en2@4ax.com...
> On Thu, 29 Apr 2004 22:50:38 -0800, "Robin" <webmaster @ infusedlight
> . net> wrote:
>
> >I have some questions on this , why isn't sub parse and sub search not
> >performing the way I want them too, they are supposed to go through all
of
> >the directories and then open the files in them and then if the contents
of
> >the file match param ('query') print the results. It's been driving me
>
> I have not read your code, but I seemed to notice some readdir()s so
> from what is described above I feel like pointing out that the
> standard answer -and indeed generally a good one!- to this kind of
> questions is 'use File::Find'. Maybe you knew, maybe you don't: if you
> didn't, it's there for your ease!


I have to check out the docs for that! Thanks.
-Robin




------------------------------

Date: Fri, 30 Apr 2004 09:59:20 -0800
From: "Robin" <webmaster @ infusedlight . net>
Subject: Re: search.pl
Message-Id: <c6u48d$1fv$6@reader2.nmix.net>


"Joe Smith" <Joe.Smith@inwap.com> wrote in message
news:_aukc.3350$0H1.362719@attbi_s54...
> Robin wrote:
>
> >      opendir (DIR, $dir);
> >      my @files_from_dir = readdir (DIR);
> >      closedir (DIR);
> >      foreach my $file (@files_from_dir)
> >       {
> >       if (! -d $file)
> >        {
> >        parse ($file, $dir);
> >        }
> >      }
> >       }
>
> 1) You really messed up on the indentation there.
> 2) Your main logic error is in the argument to -d() and parse(); it's
>     incomplete.  Anytime $dir is not the same as ".", your code will fail.
>
>    foreach my $fil (@files_from_dir) {
>      my $file = "$dir/$fil";
>      parse($file,$dir) if -f $file;
>    }
>

Thanks! I see what you mean.
-Robin





------------------------------

Date: Fri, 30 Apr 2004 15:34:36 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Suggestions on editing multiple files
Message-Id: <gmukc.3374$0H1.367575@attbi_s54>

porter970 wrote:

> I saw a post once, or and article or an example somewhere talking about
> opening a number of different files and replacing a common line of text.
> 
> I have a lot of files, maybe 100, that contain an old e-mail address.

If they are all in one set of subdirectories, you can use
   unix% perl -pi -e 's/jms\@tymnet\.com/jms\@inwap.com/g' Mail/* Mail/*/*

For win32, the one-liner above has issues with quotes (double vs single)
and potential problems with wildcards.  And the need to use -pi.bak instead.

> Is there a way to use Perl to go out to the different directories, search the
> files for the address and replace the old address with a new one?

That's what the perl module Find::File is for.
	-Joe


------------------------------

Date: Fri, 30 Apr 2004 12:25:57 -0400
From: "Gary" <reachus@netlink.info>
Subject: System Command Results
Message-Id: <C6vkc.386$nN6.54@lakeread06>

I can see how to check success or failure of a system command but how can I
see what was actually returned by the command to be able to do further
processing.

I know I could write the answer to a file and read the file but it seems
pretty crude.

G




------------------------------

Date: Fri, 30 Apr 2004 12:36:59 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: System Command Results
Message-Id: <remorse-B45DEC.12365930042004@plato.harvard.edu>

In article <C6vkc.386$nN6.54@lakeread06>, "Gary" <reachus@netlink.info> 
wrote:

> I can see how to check success or failure of a system command but how can I
> see what was actually returned by the command to be able to do further
> processing.
> 
> I know I could write the answer to a file and read the file but it seems
> pretty crude.
> 
> G

look at the 'qx' fuction (or, if you prefer, backticks (``)).

HTH>
Ricky

-- 
Pukku


------------------------------

Date: 30 Apr 2004 14:52:02 GMT
From: Stefano <vstefanoxx.bogacussu@tiscali.it>
Subject: tunneling di richieste cookies
Message-Id: <Xns94DBAB805FFF4vstefanoxx@195.130.225.75>

Salve.

Sto cercando di effettuare il download di file in perl
con libreria LWP, download che pero' richiede
anche l'invio di cookies di autenticazione, che pero'
non risiedono nel sistema che effettua il download, ma
in un pc client.

$ua->request(HTTP::Request->new('GET', $url), $dest_file)
intercetta anche le richieste annesse proveniente dal server
di destinazione relative ai cookies?
Se si, esiste una libreria perl che permetta di inoltrare in
maniera trasparente tali richieste al pc che contiene i cookies.

-- 
Stefano

Togliere .bogacussu per rispondermi in email


------------------------------

Date: Fri, 30 Apr 2004 15:30:01 +0200 (CEST)
From: Nomen Nescio <nobody@dizum.com>
Subject: WHAT IS THE POINT OF FORMMAIL ?
Message-Id: <fc48601f9736c2fbd4ac804219d29e33@dizum.com>

WHY ? No one needs this outdated crap anymore.

3 lines of PHP can do what shitty formmail does and better and more safely.

Formmail is the spammers choice, formmail is so controversial that many hosts
ban it outright.

Clunky, outdated shit and if you have an old version it is full of holes and
exploits for hackers and spammers.

Fuck of formmail you suck. Totally pointless useless shit. go away formmail




3. Matt Wright Formmail attack 

The Formmail package has become a favorite tool of spammers. 

Formmail allows a website to email form submissions to an email account. If
left unpatched a malicious user can send spam simply by including the list
of target email addresses in an HTTP request to Formmail. This behavior makes
tracking down the origin of the spam difficult because the only place the spammers
IP address is saved is in the Web logs of the affected site. 

FormMail is a widely-used web-based e-mail gateway, which allows form-based
input to be emailed to a specified user. 

When the form is submitted, the commands will be executed on the host, with
the privileges of the webserver process. This might be leveraged by the attacker
to gain local access to the host. 



http://www.securityfocus.com/corporate/research/top10attacks_q1_2002.shtml



------------------------------

Date: Fri, 30 Apr 2004 13:33:44 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: WHAT IS THE POINT OF FORMMAIL ?
Message-Id: <x7fzal4mkq.fsf@mail.sysarch.com>

>>>>> "NN" == Nomen Nescio <nobody@dizum.com> writes:

  NN> WHY ? No one needs this outdated crap anymore.
  NN> 3 lines of PHP can do what shitty formmail does and better and
  NN> more safely.

WHAT IS THE POINT OF PHP? WHY ARE YOU LIVING? WHY DID YOU SHOUT YOUR
SUBJECT? WHY IS THE SKY BLUE?

WHY ARE YOU ENTERING KILLFILES ALL OVER THE WORLD?

tune in next week to find out the answers on a new episode of 'as the
perl turns'

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Fri, 30 Apr 2004 16:14:19 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: WHAT IS THE POINT OF FORMMAIL ?
Message-Id: <87smelih4g.fsf@mithril.chromatico.net>

>>>>> "NN" == Nomen Nescio <nobody@dizum.com> writes:

    NN> WHY ? No one needs this outdated crap anymore. 

You will find little argument here, except from the stupid,
ill-informed, and lazy.  

Charlton



-- 
cwilbur at chromatico dot net
cwilbur at mac dot com


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6493
***************************************


home help back first fref pref prev next nref lref last post