Re: Yet another first website

2014-11-08 Thread Sam
On 11/08/2014 10:39 AM, Артём Варнайский wrote: Hi folks! I want to create a news website. Something like a public blog, where everyone, who wants be able to add post to the news line. I want to add new sections later (Job ads, articles on various subjects, photo gallery, etc). I know perl basics

Re: UTF8, UTF-8, utf8, Utf8 encoding blues

2014-11-08 Thread Chris Knipe
Hi Kent, > Though I haven't fully understood the problem and I'm also tired, so my tip > could be a red herring. > > The good news is if you want to remove only 3 *bytes* from the string > instead of 3 *characters* then that could be straight forward. > > And I believe ".\r\n" might be exactly 3 b

Re: UTF8, UTF-8, utf8, Utf8 encoding blues

2014-11-08 Thread Kent Fredric
On 9 November 2014 05:42, Shlomi Fish wrote: > > Should work... But the data is simply not correct. > > > > It acts as a proxy, so I receive a request, I collect the data from > > the remote server (capture the packets on the wire with tcpdump), I > > send the data to the client through perl conn

Re: Yet another first website

2014-11-08 Thread Shlomi Fish
Hi Artem, On Sat, 08 Nov 2014 19:39:49 +0300 Артём Варнайский wrote: > > Hi folks! > I want to create a news website. Something like a public blog, where > everyone, who wants be able to add post to the news line. I want to add new > sections later (Job ads, articles on various subjects, photo

Re: Yet another first website

2014-11-08 Thread Kent Fredric
On 9 November 2014 05:46, Kent Fredric wrote: > > Because when you need it, you'll know it. > Though to counter myself, it proves useful in some places if file IO is problematic or you have security concerns with direct writing to local storage. Though the first of those two points was more rel

Re: Yet another first website

2014-11-08 Thread Kent Fredric
On 9 November 2014 05:39, Артём Варнайский wrote: > Also, I have no idea how to design databases. For example, should I store > photos separately from the DB or in it? The answer to that question depends on what your database is, and what your demands are with regards to replication. Binary Bl

Re: UTF8, UTF-8, utf8, Utf8 encoding blues

2014-11-08 Thread Shlomi Fish
Hi Chris, On Sat, 8 Nov 2014 18:23:03 +0200 Chris Knipe wrote: > Hi, > > Yes, sorry. This is an entire mess :-( > > I get the content correctly (I have confirmed that numerous times > through various different ways), but printing the strings out via > STDOUT messes things up. > > Sorry for t

Re: using string as module

2014-11-08 Thread Uri Guttman
On 11/08/2014 11:38 AM, Shawn H Corey wrote: On Sat, 8 Nov 2014 17:48:31 +0200 Shlomi Fish wrote: The correct syntax is simply (untested): my $foo = "MyFoo::${pgm}Bar"->new; FYI: That is called a symbolic reference. For more information, see `perldoc perlref` and search for /Symbolic

Yet another first website

2014-11-08 Thread Артём Варнайский
Hi folks! I want to create a news website. Something like a public blog, where everyone, who wants be able to add post to the news line. I want to add new sections later (Job ads, articles on various subjects, photo gallery, etc). I know perl basics, cgi, js, css, html  and even developed small

Re: using string as module

2014-11-08 Thread Shawn H Corey
On Sat, 8 Nov 2014 17:48:31 +0200 Shlomi Fish wrote: > The correct syntax is simply (untested): > > my $foo = "MyFoo::${pgm}Bar"->new; FYI: That is called a symbolic reference. For more information, see `perldoc perlref` and search for /Symbolic references/ BTW, symbolic references are n

Re: using string as module

2014-11-08 Thread Kent Fredric
On 9 November 2014 05:27, Ron Bergin wrote: > In fact, I > almost never use or suggest using eval. > eval itself is not evil. Its just *string* eval becuase that involves arbitrary code interpolation. Non-string eval is of course potentially written as "try" in other languages ( not exactly,

Re: using string as module

2014-11-08 Thread Ron Bergin
Uri Guttman wrote: > On 11/08/2014 10:40 AM, Ron Bergin wrote: >> you could accomplish it with the use of eval. >> >> my $foo = eval "MyFoo::${pgm}Bar->new"; > > ewww. never use string eval for something as simple as that. > > my $foo = "MyFoo::${pgm}Bar"->new() ; > > that is just fine there. the c

Re: using string as module

2014-11-08 Thread Uri Guttman
On 11/08/2014 10:40 AM, Ron Bergin wrote: Patton, Billy N wrote: I currently have something like this use MyFoo::ABCBar; use MyFoo::DEFBar; use MyFoo::HIJBar; my $fooABC = MyFoo::ABCBar->new(); … What I would like to do is foreach $pgm ( ‘ABC’ , ‘DEF’ , ‘HIJ’) { my $foo = MyFo

Re: UTF8, UTF-8, utf8, Utf8 encoding blues

2014-11-08 Thread Shlomi Fish
Hi Chris, On Sat, 8 Nov 2014 11:53:44 +0200 Chris Knipe wrote: > Hi All, > > I'm reading loads, and loads of very confusing and contradicting information > about UTF8 in Perl. A lot of posts are also (rightfully IMHO) stating that > UTF8 is an absolute nightmare in Perl. > > Can someone shed

Re: using string as module

2014-11-08 Thread Shlomi Fish
Hi Billy, please reply to all recipients. On Fri, 7 Nov 2014 13:17:19 + "Patton, Billy N" wrote: > I currently have something like this > use MyFoo::ABCBar; > use MyFoo::DEFBar; > use MyFoo::HIJBar; > my $fooABC = MyFoo::ABCBar->new(); > … > > What I would like to do is > > foreach $pgm

Re: using string as module

2014-11-08 Thread Ron Bergin
Patton, Billy N wrote: > I currently have something like this > use MyFoo::ABCBar; > use MyFoo::DEFBar; > use MyFoo::HIJBar; > my $fooABC = MyFoo::ABCBar->new(); > … > > What I would like to do is > > foreach $pgm ( ‘ABC’ , ‘DEF’ , ‘HIJ’) { > my $foo = MyFoo::{$pgm}Bar->new; > …

using string as module

2014-11-08 Thread Patton, Billy N
I currently have something like this use MyFoo::ABCBar; use MyFoo::DEFBar; use MyFoo::HIJBar; my $fooABC = MyFoo::ABCBar->new(); … What I would like to do is foreach $pgm ( ‘ABC’ , ‘DEF’ , ‘HIJ’) { my $foo = MyFoo::{$pgm}Bar->new; … } This gives me an error. What is the correct syntax?

UTF8, UTF-8, utf8, Utf8 encoding blues

2014-11-08 Thread Chris Knipe
Hi All, I'm reading loads, and loads of very confusing and contradicting information about UTF8 in Perl. A lot of posts are also (rightfully IMHO) stating that UTF8 is an absolute nightmare in Perl. Can someone shed some light as to what is going on here please: use Encoding; SysLog("debug",